web,prosody: add XMPP WebSocket / Stream Management support

This commit is contained in:
Jan-Otto Kröpke
2020-04-23 21:14:11 +02:00
committed by Saúl Ibarra Corretgé
parent 130eb551a7
commit d747bfbe6b
6 changed files with 68 additions and 11 deletions

View File

@@ -1,3 +1,5 @@
{{ $ENABLE_XMPP_WEBSOCKET := .Env.ENABLE_XMPP_WEBSOCKET | default "0" | toBool }}
server_name _;
client_max_body_size 0;
@@ -50,6 +52,21 @@ location = /http-bind {
proxy_set_header Host {{ .Env.XMPP_DOMAIN }};
}
{{ if $ENABLE_XMPP_WEBSOCKET }}
# xmpp websockets
location = /xmpp-websocket {
proxy_pass {{ .Env.XMPP_BOSH_URL_BASE }}/xmpp-websocket;
proxy_http_version 1.1;
proxy_set_header Connection "upgrade";
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Host {{ .Env.XMPP_DOMAIN }};
proxy_set_header X-Forwarded-For $remote_addr;
tcp_nodelay on;
}
{{ end }}
location ~ ^/([^/?&:'"]+)$ {
try_files $uri @root_path;
}