2026-02-14 16:56:10 +00:00
|
|
|
server {
|
|
|
|
|
listen 80;
|
|
|
|
|
server_name localhost;
|
|
|
|
|
root /usr/share/nginx/html;
|
|
|
|
|
index index.html;
|
|
|
|
|
|
2026-08-09 11:41:34 +00:00
|
|
|
# Add real IP logging to Nginx access logs
|
|
|
|
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
|
|
|
|
'$status $body_bytes_sent "$http_referer" '
|
|
|
|
|
'"$http_user_agent" "$http_x_forwarded_for"';
|
|
|
|
|
|
|
|
|
|
access_log /var/log/nginx/access.log main;
|
|
|
|
|
|
2026-02-14 16:56:10 +00:00
|
|
|
location / {
|
|
|
|
|
try_files $uri $uri/ /index.html;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
location /api {
|
|
|
|
|
proxy_pass http://backend:5000;
|
2026-08-09 11:41:34 +00:00
|
|
|
|
|
|
|
|
# Forward the real IP
|
2026-02-14 16:56:10 +00:00
|
|
|
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;
|
2026-08-09 11:41:34 +00:00
|
|
|
|
|
|
|
|
# Add these headers too
|
|
|
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
|
|
|
proxy_set_header X-Forwarded-Port $server_port;
|
2026-02-14 16:56:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
location /health {
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gzip on;
|
|
|
|
|
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+text text/javascript;
|
|
|
|
|
}
|