有一种设置,例如,一个应用程序正在www.xyz.com上运行,并且有一份报告可以对www.abc.com上托管的应用程序产生打击。
由于IE8上CORS的奇怪问题,我们在www.xyz.com上投放了其余部分,但实际上服务托管在www.abc.com上,因此在ngnix级别上,我们将其余请求从www.xyz.com重定向到了www .abc.com。
但是在使用www.xzy.com应用程序上的报告后,当我们转到另一个页面时,会话将过期。使用www.xyz.com上的报告后,jsessionid会更改。
提前致谢。
服务器{ 收听80; server_name www.xyz.com; 字符集utf-8; 重写^(。*)https:// $ server_name $ 1永久; } 服务器{ 监听443; ssl on; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_certificate /etc/nginx/ssl.crt/server.crt; ssl_certificate_key /etc/nginx/ssl.key/server.key; server_name www.xyz.com; error_log /var/log/nginx/error.log; 字符集utf-8; 位置/ { proxy_pass http:// localhost:97; proxy_set_header X-Real-IP $ remote_addr; proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for; proxy_set_header主机$ http_host; client_max_body_size 10M; } location / api / rest / b2b / v1 / report / filters / program-summary { proxy_pass http:// localhost:90 / api / rest / b2b / v1 / report / filters / program-summary; proxy_redirect关闭; proxy_pass_request_headers开启; proxy_set_header X-Real-IP $ remote_addr; proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for; proxy_set_header主机$ http_host; client_max_body_size 10M; proxy_set_header X-Forwarded-Proto https; 'DNT,X-CustomHeader,保持活动,用户代理,X-请求,If-Modified-Since,缓存控制,内容类型,来源,授权,接受,客户端安全令牌'; } location / api / rest / b2b / v1 / report / headers / grid / program-summary / DATAGRID { proxy_pass http:// localhost:90 / api / rest / b2b / v1 / report / headers / grid / program-summary / DATAGRID; proxy_redirect关闭; proxy_set_header X-Real-IP $ remote_addr; proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for; proxy_pass_request_headers开启; proxy_set_header主机$ http_host; client_max_body_size 10M; proxy_set_header X-Forwarded-Proto https; 'DNT,X-CustomHeader,Keep-Alive,用户代理,X-请求的,If-Modified-Since,缓存控制,内容类型,来源,授权,接受,客户端安全令牌'; } location / api / rest / b2b / v1 / report / headers / grid / program-summary / SALES_REP { proxy_pass http:// localhost:90 / api / rest / b2b / v1 / report / headers / grid / program-summary /销售代表; proxy_redirect关闭; proxy_set_header X-Real-IP $ remote_addr; proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for; proxy_pass_request_headers开启; proxy_set_header主机$ http_host; client_max_body_size 10M; proxy_set_header主机$ http_host; proxy_set_header X-Forwarded-Proto https; 'DNT,X-CustomHeader,Keep-Alive,用户代理,X-请求的,If-Modified-Since,缓存控制,内容类型,来源,授权,接受,客户端安全令牌'; } location / api / rest / b2b / v1 / report / filters / variable / program-summary { proxy_pass http:// localhost:90 / api / rest / b2b / v1 / report / filters / variable / program-summary; proxy_redirect关闭; proxy_set_header X-Real-IP $ remote_addr; proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for; proxy_pass_request_headers开启; proxy_set_header X-Forwarded-Proto https; 'DNT,X-CustomHeader,保持活动,用户代理,X-请求,If-Modified-Since,缓存控制,内容类型,来源,授权,接受,客户端安全令牌'; } location / api / rest / b2b / v1 / query / program-summary / barchart { proxy_pass http:// localhost:90 / api / rest / b2b / v1 / query / program-summary / barchart; proxy_redirect关闭; proxy_set_header X-Real-IP $ remote_addr; proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for; proxy_pass_request_headers开启; proxy_set_header主机$ http_host; client_max_body_size 10M; proxy_set_header X-Forwarded-Proto https; 'DNT,X-CustomHeader,保持活动,用户代理,X-请求,If-Modified-Since,缓存控制,内容类型,来源,授权,接受,客户端安全令牌'; } location / api / rest / b2b / v1 / query / program-summary / datagrid { proxy_pass http:// localhost:90 / api / rest / b2b / v1 / query / program-summary / datagrid; proxy_redirect关闭; proxy_set_header X-Real-IP $ remote_addr; proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for; proxy_pass_request_headers开启; proxy_set_header主机$ http_host; client_max_body_size 10M; proxy_set_header X-Forwarded-Proto https; 'DNT,X-CustomHeader,保持活动,用户代理,X-请求,If-Modified-Since,缓存控制,内容类型,来源,授权,接受,客户端安全令牌'; } location / api / rest / b2b / v1 / query / program-summary / status_pie { proxy_pass http:// localhost:90 / api / rest / b2b / v1 / query / program-summary / status_pie; proxy_redirect关闭; proxy_set_header X-Real-IP $ remote_addr; proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for; proxy_pass_request_headers开启; proxy_set_header主机$ http_host; client_max_body_size 10M; proxy_set_header X-Forwarded-Proto https; 'DNT,X-CustomHeader,保持活动,用户代理,X-请求,If-Modified-Since,缓存控制,内容类型,来源,授权,接受,客户端安全令牌'; } location / api / rest / b2b / v1 / query / program-summary / summary { proxy_pass http:// localhost:90 / api / rest / b2b / v1 / query / program-summary / summary; proxy_redirect关闭; proxy_set_header X-Real-IP $ remote_addr; proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for; proxy_pass_request_headers开启; proxy_set_header主机$ http_host; client_max_body_size 10M; 'DNT,X-CustomHeader,保持活动,用户代理,X-请求,If-Modified-Since,缓存控制,内容类型,来源,授权,接受,客户端安全令牌'; } location / api / rest / b2b / v1 / query / program-summary / sales_datagrid { proxy_pass http:// localhost:90 / api / rest / b2b / v1 / query / program-summary / sales_datagrid; proxy_redirect关闭; proxy_set_header X-Real-IP $ remote_addr; proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for; proxy_pass_request_headers开启; proxy_set_header主机$ http_host; client_max_body_size 10M; 'DNT,X-CustomHeader,保持活动,用户代理,X-请求,If-Modified-Since,缓存控制,内容类型,来源,授权,接受,客户端安全令牌'; } location / api / rest / b2b / v2 / constants / CDN_URL { proxy_pass http:// localhost:90 / api / rest / b2b / v2 / constants / CDN_URL; proxy_redirect关闭; proxy_set_header X-Real-IP $ remote_addr; proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for; proxy_pass_request_headers开启; proxy_set_header主机$ http_host; client_max_body_size 10M; } 位置〜^ / templates /(.*)$ { 别名/ webroot / reporting-dashboard / templates / $ 1; } location〜^ / data /(.*)$ { 别名/ webroot / reporting-dashboard / data / $ 1; } location〜^ / styles /(.*)$ { 别名/ webroot / reporting-dashboard / styles / $ 1; } location〜^ / bower_components /(.*)$ { 别名/ webroot / reporting-dashboard / bower_components / $ 1; } 位置/scripts/62219e5b.vendor.js { 别名/webroot/reporting-dashboard/scripts/62219e5b.vendor.js; } 位置/scripts/9ec589bc.plugins.js { 别名/webroot/reporting-dashboard/scripts/9ec589bc.plugins.js; } 位置/scripts/e13d4652.main.js { 别名/webroot/reporting-dashboard/scripts/e13d4652.main.js; } error_page 502503504 /vzb_50x.html; 位置= /vzb_50x.html { 根/ tomcats / webapps / ROOT / static / errorFiles; } }
添加proxy_hide_header Set-Cookie;
in conf文件已解决了该问题。这基本上从响应中删除了cookie。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句