summaryrefslogtreecommitdiff
path: root/docs/installation_guide/apache-httpd.md
diff options
context:
space:
mode:
authorLibravatar Mina Galić <me+git@igalic.co>2023-01-30 09:45:01 +0000
committerLibravatar GitHub <noreply@github.com>2023-01-30 10:45:01 +0100
commit43cbe3b45c6020b104d5e5e25b251a2e860f3ded (patch)
tree715cb51b4d2f5dc545d5e8aba1d049a9989692aa /docs/installation_guide/apache-httpd.md
parent[feature] Federate reports to remote instance as Flag (if desired) (#1386) (diff)
downloadgotosocial-43cbe3b45c6020b104d5e5e25b251a2e860f3ded.tar.xz
[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).
Diffstat (limited to 'docs/installation_guide/apache-httpd.md')
-rw-r--r--docs/installation_guide/apache-httpd.md23
1 files changed, 23 insertions, 0 deletions
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
</VirtualHost>
```
+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
+
+<VirtualHost *:80 >
+ ServerName example.com
+</VirtualHost>
+
+<VirtualHost *:443>
+ 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
+</VirtualHost>
+```
+
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.