From 6b92394f09d596b9ce5068e75bf83c272b4ec22d 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 15:01:20 +0100 Subject: [PATCH] Update nginx.conf --- conf/nginx.conf | 89 ++++++++++--------------------------------------- 1 file changed, 18 insertions(+), 71 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index d799854..1a4f626 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -2,85 +2,32 @@ location __PATH__/ { # Path to source - alias __INSTALL_DIR__/; - index index.html; + alias __FINALPATH__/; - # XMPP BOSH - location __PATH__/http-bind { - proxy_pass https://localhost:5281/http-bind; + index index.html; + + # BOSH + location = __PATH__/http-bind { + proxy_pass "http://localhost:5290/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; - } - - # 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; - } - - # 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; + 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; + # CORS + location ~ .(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$ { + more_set_headers "Access-Control-Allow-Origin: *"; + #more_set_headers "Access-Control-Max-Age: 3600"; + #more_set_headers "Access-Control-Expose-Headers: Content-Length"; + #more_set_headers "Access-Control-Allow-Headers: Range"; + #more_set_headers "Accept-Ranges: bytes"; + alias __FINALPATH__/dist/; } - # 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 + # Include SSOWAT user panel. + include conf.d/yunohost_panel.conf.inc; +}