From b3f051a5aa50a61d9d4b109749fd8ffab92eb3aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 21 Feb 2023 14:55:12 +0100 Subject: [PATCH] Update nginx.conf --- conf/nginx.conf | 88 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 77 insertions(+), 11 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index fa2682d..d799854 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -3,18 +3,84 @@ location __PATH__/ { # Path to source alias __INSTALL_DIR__/; - index index.html; - # Include SSOWAT user panel. - include conf.d/yunohost_panel.conf.inc; -} + # XMPP BOSH + location __PATH__/http-bind { + proxy_pass https://localhost:5281/http-bind; + proxy_http_version 1.1; + proxy_set_header Host localhost; + 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; + } -location = __PATH__/http-bind/ { - proxy_pass "http://127.0.0.1:5290/http-bind"; -} + # XMPP HTTP-Upload + location __PATH__/upload { + proxy_pass https://f.localhost; proxy_http_version 1.1; + proxy_set_header Host localhost; + 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_set_header X-Forwarded-For $remote_addr; + proxy_buffering off; + tcp_nodelay on; + } -location ~ .(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$ { - more_set_headers "Access-Control-Allow-Origin: *"; - root __INSTALL_DIR__/; -} + # XMPP Websockets + location __PATH__/xmpp-websocket { + proxy_pass http://localhost:5280/xmpp-websocket; + proxy_http_version 1.1; + proxy_buffering off; + proxy_set_header Connection "Upgrade"; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_read_timeout 900s; + } + + # XMPP Account invite + location __PATH__/invite { + proxy_pass https://localhost:5281/invite; + proxy_http_version 1.1; + proxy_set_header Host localhost; + 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_set_header X-Forwarded-For $remote_addr; + proxy_buffering off; + tcp_nodelay on; + } + + # XMPP account register + location __PATH__/register { + proxy_pass https://localhost:5281/register; + proxy_http_version 1.1; + proxy_set_header Host localhost; + 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_set_header X-Forwarded-For $remote_addr; + proxy_buffering off; + tcp_nodelay on; + } + + # sur mon vps debian j'ai eu besoin de ça pour + # que les pages d'invitation soit bien + # formatées + #location = /share/bootstrap4/css/bootstrap.min.css { + # alias /usr/lib/nodejs/bootstrap/dist/css/bootstrap.min.css; + #} + + #location = /share/jquery/jquery.min.js { + # alias /usr/lib/nodejs/jquery/dist/jquery.min.js; + #} + + #location = /share/bootstrap4/js/bootstrap.min.js { + # alias /usr/lib/nodejs/bootstrap/dist/js/bootstrap.min.js; + #} + +} \ No newline at end of file