server { listen 80; server_name _; root /usr/share/nginx/html; index index.html; # API requests proxied to the NestJS backend (same Docker network). location /api/ { proxy_pass http://backend:3000; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; # Single hop: client IP as seen by nginx (do not append client-supplied XFF). proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; } location /health { proxy_pass http://backend:3000/health; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; } location /health/ready { proxy_pass http://backend:3000/health/ready; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; } location / { try_files $uri $uri/ /index.html; } }