From d0cbbc5af72f38578e0628f5ee7ecf71946e3ee9 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 22 Jan 2021 22:59:59 +0000 Subject: [PATCH] Hopefully final iteration of Prosody proxying --- nginx/http.template | 32 ++++++++++++++++++++++++++++++-- nginx/https.template | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 60 insertions(+), 4 deletions(-) diff --git a/nginx/http.template b/nginx/http.template index b0d1477..a413e69 100644 --- a/nginx/http.template +++ b/nginx/http.template @@ -12,10 +12,38 @@ server { try_files $uri /static/$uri @portal; } + location /admin_api { + try_files none @prosody; + } + + location /invite { + try_files none @prosody; + } + + location /invites_api { + try_files none @prosody; + } + + location /oauth2 { + try_files none @prosody; + } + + location /register { + try_files none @prosody; + } + + location /rest { + try_files none @prosody; + } + location /share { alias /usr/share/javascript; } + location /upload { + try_files none @prosody; + } + location @portal { proxy_pass http://localhost:${SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_PORT}; proxy_set_header Host $host; @@ -23,8 +51,8 @@ server { proxy_set_header X-Forwarded-Proto https; } - location /_/ { - proxy_pass http://localhost:${SNIKKET_TWEAK_INTERNAL_HTTP_PORT}/; + location @prosody { + proxy_pass http://localhost:${SNIKKET_TWEAK_INTERNAL_HTTP_PORT}; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; diff --git a/nginx/https.template b/nginx/https.template index 033b190..2c73f5c 100644 --- a/nginx/https.template +++ b/nginx/https.template @@ -21,10 +21,38 @@ server { try_files $uri /static/$uri @portal; } + location /admin_api { + try_files none @prosody; + } + + location /invite { + try_files none @prosody; + } + + location /invites_api { + try_files none @prosody; + } + + location /oauth2 { + try_files none @prosody; + } + + location /register { + try_files none @prosody; + } + + location /rest { + try_files none @prosody; + } + location /share { alias /usr/share/javascript; } + location /upload { + try_files none @prosody; + } + location @portal { proxy_pass http://localhost:${SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_PORT}; proxy_set_header Host $host; @@ -32,8 +60,8 @@ server { proxy_set_header X-Forwarded-Proto https; } - location /_/ { - proxy_pass http://localhost:${SNIKKET_TWEAK_INTERNAL_HTTP_PORT}/; + location @prosody { + proxy_pass http://localhost:${SNIKKET_TWEAK_INTERNAL_HTTP_PORT}; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https;