The actual files... -------- Ursprüngliche Nachricht -------- Von: Maik Holme <maik.ho...@mail.de> Gesendet: 27. März 2021 15:01:02 MEZ An: prosody-dev@googlegroups.com Betreff: Patch: Documentation of apache2 config Hi, this is my first try to contribute something. A patch for consistency in the docs and another to add the sample config for reverse proxys to the doc/http. --------------------------- I read most of https://documentation.divio.com/ And it seems a lot of the prosody doc are How-to guides. Some are Reference guides with some intermixing. I suppose it will be tough to rewrite everything, but a slow transition could be possible maybe. What's maybe missing most is a tutorial in the "Getting Started" section. It seems lots of people follow some step by step guide from external sites and get outdated ir strange setup's. Would you like such tutorial with all the steps to setup prosody with some community modules and a reverse proxy, so that people can learn about that while setting up prosody for their first time? -- Maik Holme (Menel) -- You received this message because you are subscribed to the Google Groups "prosody-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to prosody-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/prosody-dev/C5A6A233-F59B-4C53-88A6-D746A8409CC4%40mail.de.
# HG changeset patch # User Menel <m...@familieholme.de> # Date 1616705463 -3600 # Thu Mar 25 21:51:03 2021 +0100 # Node ID 0db29b7a3f0cbc077fb6fa9c371a1126f50477a0 # Parent 1c2738d1e466c7b8d71ce1493eb364385174ca19 Adding example config for prosody and nginx reverse proxy diff -r 1c2738d1e466 -r 0db29b7a3f0c doc/http.md --- a/doc/http.md Thu Mar 25 15:16:04 2021 +0000 +++ b/doc/http.md Thu Mar 25 21:51:03 2021 +0100 @@ -168,6 +168,39 @@ trusted_proxies = { "127.0.0.1", "::1", "192.168.1.1", } ``` +## Some Webserver example configurations of a reverse proxy. + +Apache: +See [mod\_proxy](https://httpd.apache.org/docs/current/mod/mod_proxy.html). +Firstly, ensure you have the correct modules enabled in Apache: + +``` {.code} +a2enmod proxy; a2enmod proxy_http +``` + +This example assumes your VirutalHost is named "example.com" and you did not change the default http port. +Then in the Apache config file for your domain, add the following lines: + +``` {.code} +RequestHeader set Host "example.com" #set to your prosody http_host, only necessary if it is different from the Apache2 ServerName. +ProxyPreserveHost On +ProxyPass / "http://127.0.0.1:5280/" +ProxyPassReverse / "http://127.0.0.1:5280/" +``` + +Nginx: + +``` {.code} +location / { + proxy_pass http://localhost:5280; + proxy_set_header Host "example.com"; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_buffering off; + tcp_nodelay on; +} +``` + # Adding HTTP-only hosts {#adding_http-only_hosts} You can also make a HTTP-only host via a dummy component:
# HG changeset patch # User Menel <m...@familieholme.de> # Date 1616705674 -3600 # Thu Mar 25 21:54:34 2021 +0100 # Node ID 5ddbb0d75d62ece436f1b81bbe9663bfce8f82f9 # Parent 0db29b7a3f0cbc077fb6fa9c371a1126f50477a0 bosh and websocket code update for apache2 config. diff -r 0db29b7a3f0c -r 5ddbb0d75d62 doc/setting_up_bosh.md --- a/doc/setting_up_bosh.md Thu Mar 25 21:51:03 2021 +0100 +++ b/doc/setting_up_bosh.md Thu Mar 25 21:54:34 2021 +0100 @@ -93,22 +93,23 @@ ### Apache +See [mod\_proxy](https://httpd.apache.org/docs/current/mod/mod_proxy.html). Firstly, ensure you have the correct modules enabled in Apache: ``` {.code} - sudo a2enmod rewrite proxy proxy_http +a2enmod proxy; a2enmod proxy_http ``` Then in the Apache config file for your domain, add the following lines: ``` {.code} - <Location /http-bind> - Order allow,deny - Allow from all - </Location> - RewriteEngine On - RewriteRule ^/http-bind$ http://example.com:5280/http-bind [P,L] -``` + +<Location /http-bind> +ProxyPass "http://exapmle.com:5280/http-bind" +ProxyPassReverse / "http://example.com:5280/http-bind" +</Location> + +``` Note: If your XMPP server is on the same machine as your web server, replace the target domain above (e.g. example.com) with *localhost* - diff -r 0db29b7a3f0c -r 5ddbb0d75d62 doc/websocket.md --- a/doc/websocket.md Thu Mar 25 21:51:03 2021 +0100 +++ b/doc/websocket.md Thu Mar 25 21:54:34 2021 +0100 @@ -70,7 +70,6 @@ <IfModule mod_proxy_wstunnel.c> ProxyTimeout 900 <Location "/xmpp-websocket"> - ProxyPreserveHost On ProxyPass "ws://localhost:5280/xmpp-websocket" </Location> </IfModule>