server { listen 8071; server_name _; gzip on; gzip_types text/css application/javascript application/json image/svg+xml; gzip_min_length 1024; # API and health checks are proxied to the backend container on the # shared podman network (service DNS name: backend). # # X-Real-IP and X-Forwarded-Proto are set here (not passed through), so the # backend can trust them for login throttling and redirect/scheme decisions. location /api/ { proxy_pass http://backend:8000; # $http_host keeps the client's port, which the backend's Origin check # compares against; $host would drop the port and reject real browsers. proxy_set_header Host $http_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; proxy_set_header X-Forwarded-Host $http_host; proxy_connect_timeout 5s; proxy_read_timeout 30s; } location = /healthz { proxy_pass http://backend:8000; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Host $http_host; } location / { root /usr/share/nginx/html; index index.html; try_files $uri $uri/ /index.html; } }