server { listen 8443; server_name localhost; # Proxy headers 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; # API endpoint location /api/ { proxy_pass http://localhost:8444/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_cache_bypass $http_upgrade; } # Health check endpoint location /health { access_log off; return 200 'OK'; add_header Content-Type text/plain; } # Error handling error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } }