删除原MCP旧配置,增加MCP新的配置
This commit is contained in:
parent
2a9ca98143
commit
0226c41f03
@ -58,11 +58,19 @@ server {
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
|
||||
location /api/{
|
||||
location /api/ {
|
||||
proxy_pass http://127.0.0.1:3001/;
|
||||
proxy_read_timeout 600s; #绘画任务一般持续时间较长,可以适当增加超时时间
|
||||
proxy_read_timeout 600s; # 您已设置,适合长连接
|
||||
client_max_body_size 100M;
|
||||
proxy_redirect off; # 修改重定向处理
|
||||
proxy_redirect off;
|
||||
|
||||
# --- SSE 关键配置开始 ---
|
||||
proxy_buffering off; # 必须:关闭代理缓冲,数据会立即从后端发送到客户端
|
||||
proxy_cache off; # 必须:禁用缓存,SSE是动态内容
|
||||
proxy_set_header Connection ''; # 清除 Connection header,有助于保持长连接
|
||||
proxy_http_version 1.1; # 推荐使用 HTTP/1.1
|
||||
proxy_set_header Accept-Encoding ''; # 可选:防止上游压缩导致缓冲,如果后端有gzip等压缩,可能会影响流式输出
|
||||
# --- SSE 关键配置结束 ---
|
||||
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;
|
||||
@ -81,18 +89,6 @@ server {
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_buffering off; # 对于 WebSocket 连接禁用缓冲
|
||||
}
|
||||
location /mcpserver {
|
||||
proxy_pass http://127.0.0.1:3012;
|
||||
proxy_read_timeout 300s;
|
||||
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 $connection_upgrade;
|
||||
proxy_buffering off; # 对于 WebSocket 连接禁用缓冲
|
||||
}
|
||||
}
|
||||
# chatapi 大语言模型转发子域名配置
|
||||
server {
|
||||
|
Loading…
Reference in New Issue
Block a user