zyc 9bcf943e82
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 5s
ci: 添加 Gitea Actions 部署流水线 + K3s 清单
对齐 jimeng-clone 的流水线结构(master→prod / dev→dev),适配 AirShelf 纯静态形态:
- 电商AI平台/Dockerfile · 纯 nginx,无 build 阶段
- 电商AI平台/nginx.conf · 多入口 try_files,不 fallback 到 index.html
- k8s/ · web-deployment + ingress + cert-issuer + redirect middleware
- .gitea/workflows/deploy.yaml · build/push 重试 3 次,deploy 重试 5 次,失败上报日志中心
- prod 域名 airshelf.airlabs.art / dev 域名 airshelf.test.airlabs.art

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 18:12:56 +08:00

29 lines
940 B
Nginx Configuration File

server_tokens off;
charset utf-8;
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# 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;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
# Cache static assets (CSS/JS/images/fonts)
location ~* \.(css|js|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot|mp4|webm)$ {
expires 30d;
add_header Cache-Control "public, immutable";
}
# Multi-page (not SPA): try exact file, then .html fallback (friendly URLs), then 404.
# NEVER fallback to index.html — that masks 404s for a multi-entry design shelf.
location / {
try_files $uri $uri/ $uri.html =404;
}
}