tengine-sticky

#添加sticky模块
./configure --prefix=/data/tengine --with-http_stub_status_module --with-http_ssl_module --add-module=modules/ngx_http_upstream_session_sticky_module

#官方链接
http://tengine.taobao.org/
http://tengine.taobao.org/document_cn/http_upstream_session_sticky_cn.html

#upstream设置
upstream app {
        session_sticky;
        server 11.83.2.16:80;
        server 11.83.2.17:80;
}

server {
        listen       443;
        server_name  x.x;

        location / {
            proxy_pass http://app;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $host:1443;
        }
        location /status {
	    stub_status on;
	    access_log off;
            allow 127.0.0.1;
            deny all;
	}
} 

posted @ 2020-07-30 19:33  kylingx  阅读(321)  评论(0编辑  收藏  举报