Files
amb_rag/nginx/nginx.conf
T
2026-09-01 11:53:59 +08:00

43 lines
1.3 KiB
Nginx Configuration File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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;
}
}