优化:已知问题

This commit is contained in:
2025-07-22 13:27:07 +08:00
parent 2b5ff62ff0
commit 505afb8c0d
29 changed files with 2144 additions and 6 deletions

51
proxy.conf Normal file
View File

@@ -0,0 +1,51 @@
# 反向代理配置(可选)
upstream ai-chat-backend {
server web:80;
}
server {
listen 80;
server_name localhost;
# 重定向到HTTPS如果需要
# return 301 https://$server_name$request_uri;
location / {
proxy_pass http://ai-chat-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;
# WebSocket支持
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# 超时设置
proxy_connect_timeout 60s;
proxy_send_timeout 60s;
proxy_read_timeout 60s;
}
}
# HTTPS配置如果需要
# server {
# listen 443 ssl http2;
# server_name localhost;
#
# ssl_certificate /etc/nginx/ssl/cert.pem;
# ssl_certificate_key /etc/nginx/ssl/key.pem;
#
# location / {
# proxy_pass http://ai-chat-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_http_version 1.1;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection "upgrade";
# }
# }