server { listen 3000; server_name _; root /usr/share/nginx/html; index index.html; client_max_body_size 100M; # Docker internal DNS resolver so upstream container IPs re-resolve dynamically resolver 127.0.0.11 valid=10s ipv6=off; set $backend_upstream http://najm_staging_web:8000; gzip on; gzip_vary on; gzip_proxied any; gzip_comp_level 6; gzip_types text/plain text/css text/xml application/json application/javascript image/svg+xml; location = /healthz { access_log off; default_type application/json; return 200 '{"status":"ok","service":"habib-shop-staging"}'; } location /api/shop/ { proxy_pass $backend_upstream; proxy_http_version 1.1; proxy_set_header Host habib.nwhco.ir; 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_read_timeout 300s; } location /upload-tmp-media/ { proxy_pass $backend_upstream; proxy_http_version 1.1; proxy_set_header Host habib.nwhco.ir; 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_read_timeout 300s; } location /habcoin/ { proxy_pass $backend_upstream; proxy_http_version 1.1; proxy_set_header Host habib.nwhco.ir; 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_read_timeout 300s; } location /media/ { proxy_pass $backend_upstream; proxy_http_version 1.1; proxy_set_header Host habib.nwhco.ir; 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; expires 30d; add_header Cache-Control "public, immutable"; } location /assets/ { try_files $uri =404; expires 30d; add_header Cache-Control "public, max-age=2592000, immutable"; } location / { try_files $uri $uri/ /index.html; add_header Cache-Control "no-cache"; } }