请教一个问题~
1.nginx做的反向代理。当访问http://www.123.com/abc,登陆成功后。同一个浏览器新开窗口输入http://www.123.com/abc,新旧窗口都不需要重新登陆,可正常访问
2.当新窗口输入http://www.123.com自动跳转http://www.123.com/123后,新网页需要重新登陆,原网页登出了,也需要重新登陆,这是为啥
nginx部分配置如下:
upstream localhost {
server 10.20.2.1 weight=5 max_fails=1 fail_timeout=1s;
server 10.20.2.2 weight=5 max_fails=1 fail_timeout=1s;
server 10.20.2.3 weight=5 max_fails=1 fail_timeout=1s;
}
server {
listen 80;
server_name www.123.com;
charset UTF-8;
location / {
add_header Access-Control-Allow-Origin *;
root html;
index index.jsp index.html index.htm;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_buffers 32 4k;
rewrite ^/(.*)$ /abc/$1 last;
proxy_pass http://localhost;
proxy_intercept_errors on;
expires 1d;
}
location /abc {
proxy_pass http://localhost;
proxy_redirect default ;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}