From 43cbe3b45c6020b104d5e5e25b251a2e860f3ded Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mina=20Gali=C4=87?= Date: Mon, 30 Jan 2023 09:45:01 +0000 Subject: [PATCH] [docs] Simplify Apache httpd proxy documentation (#1396) since 2.4.47 (released April 22nd 2021), Apache httpd can ProxyPass to websockets on the same URL, without mod_rewrite (and, without mod_proxy_wstunnel). --- docs/installation_guide/apache-httpd.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/installation_guide/apache-httpd.md b/docs/installation_guide/apache-httpd.md index 430ce8a3f..2f49445e6 100644 --- a/docs/installation_guide/apache-httpd.md +++ b/docs/installation_guide/apache-httpd.md @@ -96,6 +96,29 @@ MDCertificateAgreement accepted ``` +or, if you have [Apache httpd 2.4.47+](https://httpd.apache.org/docs/2.4/mod/mod_proxy.html#protoupgrade), you can get rid of both `mod_rewrite` and `mod_proxy_wstunnel` and simplify the whole config to: + +```apache +MDomain example.com auto +MDCertificateAgreement accepted + + + ServerName example.com + + + + ServerName example.com + + SSLEngine On + ProxyPreserveHost On + # set to 127.0.0.1 instead of localhost to work around https://stackoverflow.com/a/52550758 + ProxyPass / http://127.0.0.1:8080/ upgrade=websocket + ProxyPassReverse / http://127.0.0.1:8080/ + + RequestHeader set "X-Forwarded-Proto" expr=https + +``` + Again, replace occurrences of `example.com` in the above config file with the hostname of your GtS server. If your domain name is `gotosocial.example.com`, then `gotosocial.example.com` would be the correct value. You should also change `http://127.0.0.1:8080` to the correct address and port (if it's not on `127.0.0.1:8080`) of your GtS server. For example, if you're running GoToSocial on another machine with the local ip of `192.168.178.69` and on port `8080` then `http://192.168.178.69:8080/` would be the correct value.