温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

tengine会话保持功能

发布时间:2020-06-30 21:57:32 来源:网络 阅读:787 作者:素颜猪 栏目:建站服务器

1.修改nginx.conf配置文件

 upstream nginx {
        #添加如下配置
        session_sticky cookie=uid fallback=on path=/ mode=insert option=indirect
;
        server 192.168.2.140:8080;
        server 192.168.2.136:8080;
        check interval=3000 rise=2 fall=5 timeout=1000 type=http;
        check_http_send "HEAD / HTTP/1.0\r\n\r\n";
        check_http_expect_alive http_2xx http_3xx;
 }
 
 
 
  location / {
          #添加如下配置
            session_sticky_hide_cookie upstream=nginx;
            proxy_pass http://nginx;
            auth_basic off;
            auth_basic_user_file /var/user;
            root   html;
            index  index.html index.htm;
        }


2.重新启动nginx


3.参考http://tengine.taobao.org/document_cn/http_upstream_session_sticky_cn.html


向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI