From 6bfc2bf671f18a4b480fc27414749ee4961f4b1b Mon Sep 17 00:00:00 2001 From: Ruhanga <41738040+Ruhanga@users.noreply.github.com> Date: Fri, 26 Jan 2024 12:35:41 +0300 Subject: [PATCH] OZ-457: Follow-up commit to fix issue with Nginx crashing when SENAITE server is not available (#72) --- proxy/default.conf.template | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/proxy/default.conf.template b/proxy/default.conf.template index ca8e4f2..7b1a489 100644 --- a/proxy/default.conf.template +++ b/proxy/default.conf.template @@ -154,21 +154,23 @@ server { server { listen 8081; location / { - proxy_set_header Host $http_host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - rewrite ^(.*)$ /VirtualHostBase/https/$host/senaite/VirtualHostRoot/$1 break; - proxy_pass http://senaite:8080; + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + set $senaite senaite:8080; + proxy_pass http://$senaite; + rewrite ^(.*)$ /VirtualHostBase/https/$host/senaite/VirtualHostRoot/$1 break; } } server { listen 8081; location / { - proxy_set_header Host $http_host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - rewrite ^(.*)$ /VirtualHostBase/http/$host/senaite/VirtualHostRoot/$1 break; - proxy_pass http://senaite:8080; + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + set $senaite senaite:8080; + proxy_pass http://$senaite; + rewrite ^(.*)$ /VirtualHostBase/http/$host/senaite/VirtualHostRoot/$1 break; } }