From 6e6f1a44e4ee412e864c813c5fffbfbe29daa15b Mon Sep 17 00:00:00 2001 From: Xika Date: Tue, 30 Jun 2026 23:46:47 +0000 Subject: [PATCH] fix(nginx): use hostname variable in proxy_pass to fix DNS + path rewriting Using $variable:port with no path appended forces DNS re-resolution while nginx still forwards the full original request URI unchanged. Previous attempt ($upstream/api/) was dropping the request path. Co-Authored-By: Paperclip --- admin-ui/nginx.conf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/admin-ui/nginx.conf b/admin-ui/nginx.conf index b72cefa..3f9a653 100644 --- a/admin-ui/nginx.conf +++ b/admin-ui/nginx.conf @@ -2,12 +2,13 @@ server { listen 80; server_name _; - # Use Docker's embedded DNS so upstream names are re-resolved dynamically + # Use Docker's embedded DNS so upstream names are re-resolved dynamically. + # Using a variable in proxy_pass forces nginx to use this resolver on each request. resolver 127.0.0.11 valid=5s; location /api/ { - set $upstream http://api:8000; - proxy_pass $upstream/api/; + set $api_upstream api; + proxy_pass http://$api_upstream:8000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;