diff --git a/Set-up-http-proxy-server.md b/Set-up-http-proxy-server.md index 9350b01..e0d42e3 100644 --- a/Set-up-http-proxy-server.md +++ b/Set-up-http-proxy-server.md @@ -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. -> sudo apt install apache2 +> sudo apt install apache2 > > Enable the necessary modules -> a2enmod ssl -> a2enmod proxy -> a2enmod proxy_connect -> a2enmod proxy_http +> +> a2enmod ssl +> a2enmod proxy +> a2enmod proxy_connect +> a2enmod proxy_http > > Create a file with proxy-user credentials: > > 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: > -> -> SSLEngine on -> SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem -> SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key +> +> SSLEngine on +> SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem +> SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key > > ProxyRequests 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 > Require valid-user > -> +> > > Disable the default site and enable the proxy config: > -> sudo a2dissite 000-default.conf -> sudo a2ensite rustdesk.conf -> sudo service apache2 restart +> sudo a2dissite 000-default.conf +> sudo a2ensite rustdesk.conf +> 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`. > -> -> SSLEngine on -> SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem -> SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key +> +> SSLEngine on +> SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem +> SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key > -> ProxyPass / http://127.0.0.1:21114/ -> ProxyPassReverse / http://127.0.0.1:21114/ -> +> ProxyPass / http://127.0.0.1:21114/ +> ProxyPassReverse / http://127.0.0.1:21114/ +> > > Change the line -> AllowCONNECT 21114-21119 +> +> AllowCONNECT 21114-21119 > into -> AllowCONNECT 4443 21114-21119 +> +> AllowCONNECT 4443 21114-21119 > -> Restart apache2 -> sudo service apache2 restart +> Restart `apache2` +> +> 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: -> ufw allow 443/tcp -> ufw allow 4443/tcp +> 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: ![image](https://github.com/user-attachments/assets/b2d0db7e-b42b-4077-9bdc-ce003ac677d2)