From 554d1ff2b6591dc21fa2aac2bc28bac18b50eea9 Mon Sep 17 00:00:00 2001 From: Dhrumil Shah Date: Wed, 4 Sep 2024 00:07:43 -0400 Subject: [PATCH] Add set directives for proxies to keep from crashing if upstream is down --- backend/templates/_location.conf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/templates/_location.conf b/backend/templates/_location.conf index b756322..fcc7d12 100644 --- a/backend/templates/_location.conf +++ b/backend/templates/_location.conf @@ -6,7 +6,12 @@ proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Real-IP $remote_addr; - proxy_pass {{ forward_scheme }}://{{ forward_host }}:{{ forward_port }}{{ forward_path }}; + + set $proxy_forward_scheme {{ forward_scheme }}; + set $proxy_server "{{ forward_host }}"; + set $proxy_port {{ forward_port }}; + + proxy_pass $proxy_forward_scheme://$proxy_server:$proxy_port{{ forward_path }}; {% include "_access.conf" %} {% include "_assets.conf" %}