When configuring url rewrite in nginx, in order to keep the URL in the browser address bar unchanged, proxy_pass reverse proxy is used, but a new jsessionid will be generated every time. The specific configuration is as follows:
location =/ {
rewrite ^/(.*) /zk/user/index.action break;
proxy_pass http://www.sozhike.com;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
chunked_transfer_encoding off;
}
How can I prevent a new jsessionid from being generated when using proxy_pass?
将你的session统一管理,例如:使用一台memcache来管理所有的session.
Set-Cookie:
这个header没有传过去?是不是需要通过配置手动把把这个header传给upstream?