Skip to content

Commit 7c1c011

Browse files
authored
Add HAProxy example for single port operation (#16768)
1 parent cdbbf36 commit 7c1c011

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

changelog.d/16768.doc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add HAProxy example for single port operation to reverse proxy documentation. Contributed by Georg Pfuetzenreuter (@tacerus).

docs/reverse_proxy.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,25 @@ Example configuration, if using a UNIX socket. The configuration lines regarding
186186
backend matrix
187187
server matrix unix@/run/synapse/main_public.sock
188188
```
189+
Example configuration when using a single port for both client and federation traffic.
190+
```
191+
frontend https
192+
bind *:443,[::]:443 ssl crt /etc/ssl/haproxy/ strict-sni alpn h2,http/1.1
193+
http-request set-header X-Forwarded-Proto https if { ssl_fc }
194+
http-request set-header X-Forwarded-Proto http if !{ ssl_fc }
195+
http-request set-header X-Forwarded-For %[src]
196+
197+
acl matrix-host hdr(host) -i matrix.example.com matrix.example.com:443
198+
acl matrix-sni ssl_fc_sni matrix.example.com
199+
acl matrix-path path_beg /_matrix
200+
acl matrix-path path_beg /_synapse/client
201+
202+
use_backend matrix if matrix-host matrix-path
203+
use_backend matrix if matrix-sni
204+
205+
backend matrix
206+
server matrix 127.0.0.1:8008
207+
```
189208

190209
[Delegation](delegate.md) example:
191210
```

0 commit comments

Comments
 (0)