From 2160abf4e5ca6a138a541f8da10a4e326f8164ff Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 22 Jul 2021 10:14:44 +0200 Subject: [PATCH] Set web-socket --- conf/nginx.conf | 17 ++++++++++------- sources/index.html | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 4ff7bc7..ec2c803 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -12,15 +12,18 @@ location __PATH__/ { } # BOSH - location = __PATH__/http-bind { + location = __PATH__/xmpp-websocket { proxy_pass "http://localhost:5290/http-bind"; - proxy_http_version 1.1; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; proxy_buffering off; - tcp_nodelay on; + proxy_set_header Host $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_read_timeout 86400; + } + # CORS + location ~ .(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$ { + add_header "Access-Control-Allow-Origin: '*'"; # Decide here whether you want to allow all or only a particular domain + root __FINALPATH__/; # Properly set the path here } # Include SSOWAT user panel. diff --git a/sources/index.html b/sources/index.html index 4e76fb9..b109336 100644 --- a/sources/index.html +++ b/sources/index.html @@ -51,7 +51,7 @@ authentication: 'login', auto_away: 300, auto_reconnect: true, - bosh_service_url: 'https://__DOMAIN____PATH__/http-bind', + websocket_url: 'wss://__DOMAIN____PATH__/ws/', default_domain: '__MAINDOMAIN__', message_archiving: 'always', view_mode: 'fullscreen',