diff --git a/readme.md b/readme.md index e42e6938..54f802d1 100644 --- a/readme.md +++ b/readme.md @@ -149,6 +149,38 @@ server } ``` +### Apache Reverse Proxy + +Add this to the site config file on your Apache server after you have changed the relevant parts in the <> brackets, and inserted the path to you certificates. +For this to work you must enable at least the following mods using `a2enmod`: + - `ssl` + - `proxy_module` + - `proxy_wstunnel_module` + - `rewrite_module` + +```bash + + + ServerName .. + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + + ProxyPreserveHost On + ProxyPass / http://localhost:/ + RewriteEngine on + RewriteCond %{HTTP:Upgrade} websocket [NC] + RewriteCond %{HTTP:Connection} upgrade [NC] + RewriteRule ^/?(.*) "ws://localhost:/$1" [P,L] + + # unless you're doing something special this should be generated by a + # tool like certbot by let's encrypt + SSLCertificateFile /path/to/cert/file + SSLCertificateKeyFile /path/to/key/file + + +``` + ## Contributing