mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-24 10:35:46 +03:00
Add HAProxy example for single port operation (#16768)
This commit is contained in:
parent
cdbbf3653d
commit
7c1c011942
2 changed files with 20 additions and 0 deletions
1
changelog.d/16768.doc
Normal file
1
changelog.d/16768.doc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Add HAProxy example for single port operation to reverse proxy documentation. Contributed by Georg Pfuetzenreuter (@tacerus).
|
|
@ -186,6 +186,25 @@ Example configuration, if using a UNIX socket. The configuration lines regarding
|
||||||
backend matrix
|
backend matrix
|
||||||
server matrix unix@/run/synapse/main_public.sock
|
server matrix unix@/run/synapse/main_public.sock
|
||||||
```
|
```
|
||||||
|
Example configuration when using a single port for both client and federation traffic.
|
||||||
|
```
|
||||||
|
frontend https
|
||||||
|
bind *:443,[::]:443 ssl crt /etc/ssl/haproxy/ strict-sni alpn h2,http/1.1
|
||||||
|
http-request set-header X-Forwarded-Proto https if { ssl_fc }
|
||||||
|
http-request set-header X-Forwarded-Proto http if !{ ssl_fc }
|
||||||
|
http-request set-header X-Forwarded-For %[src]
|
||||||
|
|
||||||
|
acl matrix-host hdr(host) -i matrix.example.com matrix.example.com:443
|
||||||
|
acl matrix-sni ssl_fc_sni matrix.example.com
|
||||||
|
acl matrix-path path_beg /_matrix
|
||||||
|
acl matrix-path path_beg /_synapse/client
|
||||||
|
|
||||||
|
use_backend matrix if matrix-host matrix-path
|
||||||
|
use_backend matrix if matrix-sni
|
||||||
|
|
||||||
|
backend matrix
|
||||||
|
server matrix 127.0.0.1:8008
|
||||||
|
```
|
||||||
|
|
||||||
[Delegation](delegate.md) example:
|
[Delegation](delegate.md) example:
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in a new issue