diff --git a/frontend/nginx.conf b/frontend/nginx.conf index 504c797..0783a06 100644 --- a/frontend/nginx.conf +++ b/frontend/nginx.conf @@ -11,8 +11,14 @@ server { resolver 127.0.0.11 valid=30s; location /api/ { - set $backend_upstream http://presencia-backend:4790; - proxy_pass $backend_upstream/api/; + set $backend_upstream presencia-backend; + # $request_uri (the raw, un-normalized original URI) must be appended + # explicitly: when the proxy_pass target is built from a variable, + # nginx does NOT replace the matched location prefix with the rest of + # the request URI like it does for a static proxy_pass value — it + # would otherwise always forward the literal "/api/" with nothing + # appended, regardless of the actual path requested. + proxy_pass http://$backend_upstream:4790$request_uri; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr;