Files
TaskPool/nginx-standalone.conf
T
admin 8928c348df
Build and Deploy / build-and-push (push) Successful in 10s
Build and Deploy / deploy (push) Failing after 0s
feat: add standalone Dockerfile with frontend and backend
2026-07-21 22:17:22 +08:00

33 lines
867 B
Plaintext

server {
listen 3000;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
# Gzip
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml text/javascript;
gzip_min_length 1000;
# SPA fallback
location / {
try_files $uri $uri/ /index.html;
}
# API proxy - 指向同一容器内的后端
location /api/ {
proxy_pass http://127.0.0.1:8052;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
# Cache static assets
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
}