From e9d4f5b827564fcb90883a77710779192495f260 Mon Sep 17 00:00:00 2001 From: mitossoft-rd <106842163+mitossoft-rd@users.noreply.github.com> Date: Mon, 28 Oct 2024 02:59:23 +0300 Subject: [PATCH 1/3] Remove variable usage from proxy_pass directive to fix resolution issues By using a static URL, the backend server can be accessed reliably, avoiding the common 404 errors or "no resolver defined" issues seen when variables are used. --- backend/templates/_location.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/templates/_location.conf b/backend/templates/_location.conf index fcc7d12..04a4b18 100644 --- a/backend/templates/_location.conf +++ b/backend/templates/_location.conf @@ -11,7 +11,7 @@ set $proxy_server "{{ forward_host }}"; set $proxy_port {{ forward_port }}; - proxy_pass $proxy_forward_scheme://$proxy_server:$proxy_port{{ forward_path }}; + proxy_pass {{ forward_scheme }}:{{ forward_host }}:{{ forward_port }}{{ forward_path }}; {% include "_access.conf" %} {% include "_assets.conf" %} From a55de386e74cb21cf35a60251bf1e920c9aca062 Mon Sep 17 00:00:00 2001 From: mitossoft-rd <106842163+mitossoft-rd@users.noreply.github.com> Date: Mon, 28 Oct 2024 15:15:08 +0300 Subject: [PATCH 2/3] Fix URL format --- backend/templates/_location.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/templates/_location.conf b/backend/templates/_location.conf index 04a4b18..ba9ea69 100644 --- a/backend/templates/_location.conf +++ b/backend/templates/_location.conf @@ -11,7 +11,7 @@ set $proxy_server "{{ forward_host }}"; set $proxy_port {{ forward_port }}; - proxy_pass {{ forward_scheme }}:{{ forward_host }}:{{ forward_port }}{{ forward_path }}; + proxy_pass {{ forward_scheme }}://{{ forward_host }}:{{ forward_port }}{{ forward_path }}; {% include "_access.conf" %} {% include "_assets.conf" %} From f7d3ca0b07a51578350575f53799529905758d83 Mon Sep 17 00:00:00 2001 From: mitossoft-rd <106842163+mitossoft-rd@users.noreply.github.com> Date: Mon, 28 Oct 2024 15:18:54 +0300 Subject: [PATCH 3/3] Cleaning unused variable. --- backend/templates/_location.conf | 4 ---- 1 file changed, 4 deletions(-) diff --git a/backend/templates/_location.conf b/backend/templates/_location.conf index ba9ea69..a2ecb16 100644 --- a/backend/templates/_location.conf +++ b/backend/templates/_location.conf @@ -7,10 +7,6 @@ proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Real-IP $remote_addr; - set $proxy_forward_scheme {{ forward_scheme }}; - set $proxy_server "{{ forward_host }}"; - set $proxy_port {{ forward_port }}; - proxy_pass {{ forward_scheme }}://{{ forward_host }}:{{ forward_port }}{{ forward_path }}; {% include "_access.conf" %}