mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-16 05:21:28 +03:00
Updated Set up http proxy server (markdown)
@@ -101,24 +101,25 @@ You can hide `Tinyproxy` behind `NGINX` to create a true `https` proxy, but ther
|
|||||||
|
|
||||||
One RustDesk user shared his method for creating an HTTPS proxy with Apache2. I have never tested, but you can try yourself.
|
One RustDesk user shared his method for creating an HTTPS proxy with Apache2. I have never tested, but you can try yourself.
|
||||||
|
|
||||||
> sudo apt install apache2
|
> sudo apt install apache2
|
||||||
>
|
>
|
||||||
> Enable the necessary modules
|
> Enable the necessary modules
|
||||||
> a2enmod ssl
|
>
|
||||||
> a2enmod proxy
|
> a2enmod ssl
|
||||||
> a2enmod proxy_connect
|
> a2enmod proxy
|
||||||
> a2enmod proxy_http
|
> a2enmod proxy_connect
|
||||||
|
> a2enmod proxy_http
|
||||||
>
|
>
|
||||||
> Create a file with proxy-user credentials:
|
> Create a file with proxy-user credentials:
|
||||||
>
|
>
|
||||||
> sudo htpasswd -b -c /etc/apache2/.htpasswd proxy-user your-password
|
> sudo htpasswd -b -c /etc/apache2/.htpasswd proxy-user your-password
|
||||||
>
|
>
|
||||||
> Create a file /etc/apache2/sites-available/rustdesk.conf and add below lines:
|
> Create a file `/etc/apache2/sites-available/rustdesk.conf` and add below lines:
|
||||||
>
|
>
|
||||||
> <VirtualHost *:443>
|
> <VirtualHost *:443>
|
||||||
> SSLEngine on
|
> SSLEngine on
|
||||||
> SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
|
> SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
|
||||||
> SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
|
> SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
|
||||||
>
|
>
|
||||||
> ProxyRequests On
|
> ProxyRequests On
|
||||||
> ProxyVia On
|
> ProxyVia On
|
||||||
@@ -129,36 +130,40 @@ One RustDesk user shared his method for creating an HTTPS proxy with Apache2. I
|
|||||||
> AuthUserFile /etc/apache2/.htpasswd
|
> AuthUserFile /etc/apache2/.htpasswd
|
||||||
> Require valid-user
|
> Require valid-user
|
||||||
> </Proxy>
|
> </Proxy>
|
||||||
> </VirtualHost>
|
> </VirtualHost>
|
||||||
>
|
>
|
||||||
> Disable the default site and enable the proxy config:
|
> Disable the default site and enable the proxy config:
|
||||||
>
|
>
|
||||||
> sudo a2dissite 000-default.conf
|
> sudo a2dissite 000-default.conf
|
||||||
> sudo a2ensite rustdesk.conf
|
> sudo a2ensite rustdesk.conf
|
||||||
> sudo service apache2 restart
|
> sudo service apache2 restart
|
||||||
>
|
>
|
||||||
> If you want to use ssl for the web console you can add another virtualhost to /etc/apache2/sites-available/rustdesk.conf. As port 443 is already used for the forwarding proxy, you can use for example port 4443.
|
> If you want to use ssl for the web console you can add another virtualhost to `/etc/apache2/sites-available/rustdesk.conf`. As port `443` is already used for the forwarding proxy, you can use for example port `4443`.
|
||||||
>
|
>
|
||||||
> <VirtualHost *:4443>
|
> <VirtualHost *:4443>
|
||||||
> SSLEngine on
|
> SSLEngine on
|
||||||
> SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
|
> SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
|
||||||
> SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
|
> SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
|
||||||
>
|
>
|
||||||
> ProxyPass / http://127.0.0.1:21114/
|
> ProxyPass / http://127.0.0.1:21114/
|
||||||
> ProxyPassReverse / http://127.0.0.1:21114/
|
> ProxyPassReverse / http://127.0.0.1:21114/
|
||||||
> </VirtualHost>
|
> </VirtualHost>
|
||||||
>
|
>
|
||||||
> Change the line
|
> Change the line
|
||||||
> AllowCONNECT 21114-21119
|
>
|
||||||
|
> AllowCONNECT 21114-21119
|
||||||
> into
|
> into
|
||||||
> AllowCONNECT 4443 21114-21119
|
|
||||||
>
|
>
|
||||||
> Restart apache2
|
> AllowCONNECT 4443 21114-21119
|
||||||
> sudo service apache2 restart
|
|
||||||
>
|
>
|
||||||
> As all ports of hhhbs and hbbr are connected via proxy, you can disable these ports in ufw. You only need to open port 443 and 4443:
|
> Restart `apache2`
|
||||||
> ufw allow 443/tcp
|
>
|
||||||
> ufw allow 4443/tcp
|
> sudo service apache2 restart
|
||||||
|
>
|
||||||
|
> As all ports of `hbbs` and `hbbr` are connected via proxy, you can disable these ports in ufw. You only need to open port `443` and `4443`:
|
||||||
|
>
|
||||||
|
> ufw allow 443/tcp
|
||||||
|
> ufw allow 4443/tcp
|
||||||
>
|
>
|
||||||
> Finally configure it on rustdesk:
|
> Finally configure it on rustdesk:
|
||||||

|

|
||||||
|
|||||||
Reference in New Issue
Block a user