Files
gamegroup2/frontend/nginx.conf
T
congsh 09a7fe7708 fix: remove duplicate migrations, fix Dev nginx proxy target
- Remove 6 duplicate Phase 2 migration files (1776500001-0006) that
  failed on restart and blocked Phase 3 migrations from running
- Fix Dev nginx.conf proxy target from 192.168.1.14:8090 to
  gamegroup-pb:8090 (Docker internal DNS) since host port 8090 is
  not exposed (mapped as 8711:8090)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 20:14:11 +08:00

53 lines
1.7 KiB
Nginx Configuration File

server {
listen 80;
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 application/xml+rss text/javascript;
location / {
try_files $uri $uri/ /index.html;
add_header Cache-Control "no-cache, no-store, must-revalidate";
add_header Pragma "no-cache";
add_header Expires "0";
}
# SSE realtime 连接(必须在 /api/ 之前)
location /api/realtime {
proxy_pass http://gamegroup-pb:8090;
proxy_http_version 1.1;
proxy_set_header Connection '';
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_buffering off;
proxy_cache off;
proxy_read_timeout 86400s;
gzip off;
}
# API 代理到局域网 PocketBase
location /api/ {
client_max_body_size 500m;
proxy_pass http://gamegroup-pb:8090;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
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/ 路径)
location ~* ^/(?!api/).*\.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot|webp|mp4|mkv|webm|mp3|ogg|pdf)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
}