From 05be496817e554fb32bab68368aaa37ee4ebdecc Mon Sep 17 00:00:00 2001 From: zvon Date: Sun, 24 Oct 2021 10:26:29 +0200 Subject: [PATCH] Updated Readme to include Apache config. --- readme.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) 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