企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
## 1、Nginx--keepalive 的配置 1.1 从 Client 到 Nginx 的连接是长连接; ![](https://img.kancloud.cn/9d/45/9d45ac137f109fa517fdc7f3d6686bae_805x743.png) 1.2 从 Nginx 到 Server(upstream) 的长连接 `vim /www/server/panel/vhost/nginx/leveling_www_dyhjw_com.conf` 增加:` keepalive 300; ` ``` upstream www_dyhjw_com { #ip_hash; server 192.168.0.203:80 max_fails=2 fail_timeout=180s weight=10; server 192.168.0.198:80 max_fails=2 fail_timeout=180s weight=10; server 192.168.0.201:80 max_fails=2 fail_timeout=180s weight=10; server 192.168.0.212:80 max_fails=2 fail_timeout=180s down; server 192.168.0.204:80 max_fails=2 fail_timeout=180s weight=10; sticky name=bt_route expires=12h httponly; # 这个参数非常重要 keepalive 300; } ```