利用memcached配置session一致性另外一種方案
阿新 • • 發佈:2019-02-09
紅色標註部分
upstream nginx {
session_sticky cookie=uid fallback=on path=/ mode=insert option=indirect;
server 192.168.0.166:8080;
server 192.168.0.188: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;
}
server {
listen 80;
server_name www.nginx1.com;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
session_sticky_hide_cookie upstream=nginx;
proxy_pass http://nginx;
root html;
index index.html index.htm;
}