第一步

This commit is contained in:
amb
2026-09-01 11:53:59 +08:00
commit 47bf6cc5ca
66 changed files with 6501 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
# AI Knowledge Link — Nginx 生产配置
# Docker Compose 中 frontend 容器 serve 静态产物,此配置用于独立 nginx 容器反代。
upstream backend {
server backend:8000;
}
server {
listen 80;
server_name _;
client_max_body_size 25m;
# --- 管理端 API ---
location /api/ {
proxy_pass http://backend;
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_read_timeout 60s;
}
# --- 公共 AI 页面 ---
# 禁止 Nginx 层缓存(公共页缓存只允许应用内,键含 token_hash
location /k/ {
proxy_pass http://backend;
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;
add_header Cache-Control "private, no-cache, no-store" always;
add_header X-Robots-Tag "noindex, nofollow, noarchive" always;
}
# --- 前端静态 ---
location / {
proxy_pass http://frontend:80;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}