didi-lot2-backend/backend/admin-dashboard/nginx.conf
2026-07-10 03:39:53 -07:00

53 lines
No EOL
1.6 KiB
Nginx Configuration File

server {
listen 3000;
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
# Enable gzip
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
# Proxy to Agent V3 API
location /agent-v3/ {
resolver 127.0.0.11 valid=30s;
set $agent_upstream didi-agent-v3;
rewrite ^/agent-v3/(.*) /$1 break;
proxy_pass http://$agent_upstream:24803;
proxy_http_version 1.1;
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;
}
# Proxy to Framework API
location /framework/ {
resolver 127.0.0.11 valid=30s;
set $framework_upstream didi-framework;
rewrite ^/framework/(.*) /$1 break;
proxy_pass http://$framework_upstream:3005;
proxy_http_version 1.1;
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;
}
location / {
try_files $uri $uri/ /index.html;
}
# Cache static assets
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
}