首页 文章

Ngnix Jsession改变了重定向问题

提问于
浏览
2

有一个设置就像在www.xyz.com上运行一个应用程序,并且有一个报告可以对www.abc.com上托管的应用程序进行休息 .

由于IE8上CORS的奇怪问题,我们正在www.xyz.com上进行其余的访问,但实际上服务是在www.abc.com上托管的,因此在ngnix级别我们将其余请求从www.xyz.com重定向到www .abc.com .

但是当我们转到另一个页面时使用www.xzy.com app上的报告后,会话就会过期 . 使用www.xyz.com上的报告后,jsessionid发生了变化 .

提前致谢 .

server {
            listen 80;
            server_name www.xyz.com;
            charset utf-8;
            rewrite     ^(.*)   https://$server_name$1 permanent;
    }

    server {
            listen 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;
            charset utf-8;


            location / {
                    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 Host $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 off;
                proxy_pass_request_headers on;
                 proxy_set_header X-Real-IP $remote_addr;
                 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                 proxy_set_header Host $http_host;
                client_max_body_size 10M;
                proxy_set_header X-Forwarded-Proto https;
    'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,origin,authorization,accept,client-security-token';
            }
           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 off;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
               proxy_pass_request_headers on;
               proxy_set_header Host $http_host;
                client_max_body_size 10M;
                proxy_set_header X-Forwarded-Proto https;
    'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,origin,authorization,accept,client-security-token';
            }

            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/SALES_REP;
                proxy_redirect off;
                proxy_set_header X-Real-IP $remote_addr;
               proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
               proxy_pass_request_headers on;
               proxy_set_header Host $http_host;
                client_max_body_size 10M;
                proxy_set_header X-Forwarded-Proto https;
    'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,origin,authorization,accept,client-security-token';
            }
            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 off;
                 proxy_set_header X-Real-IP $remote_addr;
                 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_pass_request_headers on;
                proxy_set_header Host $http_host;
                proxy_set_header X-Forwarded-Proto https;
    'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,origin,authorization,accept,client-security-token';
            }

            location /api/rest/b2b/v1/query/program-summary/barchart {
                proxy_pass  http://localhost:90/api/rest/b2b/v1/query/program-summary/barchart;
                proxy_redirect off;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_pass_request_headers on;
                proxy_set_header Host $http_host;
                client_max_body_size 10M;
                proxy_set_header X-Forwarded-Proto https;
    'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,origin,authorization,accept,client-security-token';
            }
             location /api/rest/b2b/v1/query/program-summary/datagrid {
                proxy_pass   http://localhost:90/api/rest/b2b/v1/query/program-summary/datagrid;
                proxy_redirect off;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_pass_request_headers on;
                proxy_set_header Host $http_host;
                client_max_body_size 10M;
                proxy_set_header X-Forwarded-Proto https;
    'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,origin,authorization,accept,client-security-token';
            }
             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 off;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_pass_request_headers on;
                proxy_set_header Host $http_host;
                client_max_body_size 10M;
                proxy_set_header X-Forwarded-Proto https;
    'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,origin,authorization,accept,client-security-token';
            }

             location /api/rest/b2b/v1/query/program-summary/summary {
                proxy_pass     http://localhost:90/api/rest/b2b/v1/query/program-summary/summary;
                proxy_redirect off;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_pass_request_headers on;
                proxy_set_header Host $http_host;
                client_max_body_size 10M; 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,origin,authorization,accept,client-security-token';
            }
            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 off;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_pass_request_headers on;
                proxy_set_header Host $http_host;
                client_max_body_size 10M;
    'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,origin,authorization,accept,client-security-token';
            }
            location  /api/rest/b2b/v2/constants/CDN_URL {
                    proxy_pass    http://localhost:90/api/rest/b2b/v2/constants/CDN_URL;
                    proxy_redirect off;
                    proxy_set_header X-Real-IP $remote_addr;
                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                    proxy_pass_request_headers on;
                    proxy_set_header Host $http_host;
                    client_max_body_size 10M;
            }
            location ~ ^/templates/(.*)$ {
                    alias /webroot/reporting-dashboard/templates/$1;
            }

            location ~ ^/data/(.*)$ {
                    alias /webroot/reporting-dashboard/data/$1;
            }

            location ~ ^/styles/(.*)$ {
                    alias /webroot/reporting-dashboard/styles/$1;
            }

            location ~ ^/bower_components/(.*)$ {
                    alias /webroot/reporting-dashboard/bower_components/$1;
            }

            location /scripts/62219e5b.vendor.js {
                    alias /webroot/reporting-dashboard/scripts/62219e5b.vendor.js;
            }

            location /scripts/9ec589bc.plugins.js {
                    alias /webroot/reporting-dashboard/scripts/9ec589bc.plugins.js;
            }

            location /scripts/e13d4652.main.js {
                    alias /webroot/reporting-dashboard/scripts/e13d4652.main.js;
            }


            error_page   502 503 504  /vzb_50x.html;
                location = /vzb_50x.html {
                root   /tomcats/webapps/ROOT/static/errorFiles;
            }
    }

1 回答

相关问题