qwe
Some checks failed
Docker Build and Deploy / build-and-push (push) Failing after 15s
Docker Build and Deploy / deploy-hk (push) Has been skipped

This commit is contained in:
zch1234qq
2025-10-20 23:41:07 +08:00
parent 62c08e7132
commit b71e8502ba
8 changed files with 92 additions and 6091 deletions

View File

@ -2,37 +2,18 @@ server {
listen 80;
server_name localhost;
# Next.js项目的根目录
root /usr/share/nginx/html;
index index.html;
# Next.js路由配置
# 支持Next.js路由
location / {
try_files $uri $uri/ /index.html;
}
# 处理Next.js静态资源
location /_next/ {
alias /usr/share/nginx/html/_next/;
expires 30d;
access_log off;
}
# 处理API路由
location /api/ {
proxy_pass http://localhost:3000;
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;
}
# 静态文件缓存
location ~* \.(jpg|jpeg|png|gif|ico|css|js|svg|woff|woff2|ttf|eot)$ {
location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
expires 30d;
add_header Cache-Control "public, no-transform";
access_log off;
}
# 错误页面