server { listen 80; server_name _; root /var/www/html; index index.html; # API requests → .NET backend location /api/ { proxy_pass http://localhost: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; } # Health check location /health { proxy_pass http://localhost:5000; } # Swagger (dev only, but harmless) location /swagger { proxy_pass http://localhost:5000; } # SPA fallback location / { try_files $uri $uri/ /index.html; } }