From 98d496ccafc4bc8b7e79f7e7ec7140556efb0df0 Mon Sep 17 00:00:00 2001 From: tavo-wasd Date: Thu, 19 Oct 2023 14:20:48 -0600 Subject: [PATCH] xmpp-web init --- self_hosting/services/xmpp-web/local.js | 3 +++ self_hosting/services/xmpp-web/xmpp-web.conf | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 self_hosting/services/xmpp-web/local.js create mode 100644 self_hosting/services/xmpp-web/xmpp-web.conf diff --git a/self_hosting/services/xmpp-web/local.js b/self_hosting/services/xmpp-web/local.js new file mode 100644 index 0000000..33d17fa --- /dev/null +++ b/self_hosting/services/xmpp-web/local.js @@ -0,0 +1,3 @@ +websocket: 'ws://CHAT.DOMAIN.ORG/xmpp-websocket', +// wss for encrypted connections on port 5443: +//websocket: 'wss://CHAT.DOMAIN.ORG/xmpp-websocket', diff --git a/self_hosting/services/xmpp-web/xmpp-web.conf b/self_hosting/services/xmpp-web/xmpp-web.conf new file mode 100644 index 0000000..a71014b --- /dev/null +++ b/self_hosting/services/xmpp-web/xmpp-web.conf @@ -0,0 +1,20 @@ +server { + listen 80; + listen [::]:80; + + server_name CHAT.DOMAIN.ORG; + + root /var/www/xmpp-web + + location /xmpp-websocket { + # Proxy traffic to XMPP websocket + # Use port 5443 for wss (encrypted) connections + #proxy_pass http://CHAT.DOMAIN.ORG:5443/xmpp-websocket; + proxy_pass http://CHAT.DOMAIN.ORG:5280/xmpp-websocket; + + # These allow websockets over http + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + } +}