add websocket templates to nginx example config

This commit is contained in:
paweldomas 2020-01-24 11:41:30 -06:00 committed by Paweł Domas
parent b25db3ce2e
commit 74a5eb2d81
1 changed files with 19 additions and 0 deletions

View File

@ -59,6 +59,16 @@ server {
proxy_set_header Host $http_host;
}
# xmpp websockets
location = /xmpp-websocket {
proxy_pass http://127.0.0.1:5280/xmpp-websocket?prefix=$prefix&$args;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
tcp_nodelay on;
}
location ~ ^/([^/?&:'"]+)$ {
try_files $uri @root_path;
}
@ -90,4 +100,13 @@ server {
rewrite ^/(.*)$ /http-bind;
}
# websockets for subdomains
location ~ ^/([^/?&:'"]+)/xmpp-websocket {
set $subdomain "$1.";
set $subdir "$1/";
set $prefix "$1";
rewrite ^/(.*)$ /xmpp-websocket;
}
}