diff --git a/nginx.conf b/nginx.conf index 1a46009..2d8f296 100644 --- a/nginx.conf +++ b/nginx.conf @@ -9,11 +9,14 @@ server { } # Proxy API calls to the backend service - location /api/ { + # Exact match on /api — avoids the 301 redirect nginx emits for + # location /api/ when the client posts to bare /api (POST→GET on 301) + location = /api { proxy_pass http://backend:5000/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; } # Rewrite /{lang}/result/{id} to /{lang}/result/id/index.html