欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

nginx问题——session丢失

程序员文章站 2022-07-14 22:27:12
...


server{
        listen 80;
        server_name www.jiahemdata.com www.jiahemdata.cn;
        root /opt/tomcat-jhyx/webapps/jhyx/;
        charset utf-8;
        location /{
            proxy_redirect off;
            proxy_pass http://127.0.0.1:8093/jhyx/;
            proxy_cookie_path /jhyx/ /;
            proxy_cookie_path /jhyx /;
            proxy_set_header Host $host;
            proxy_set_header Referer $http_referer;
            proxy_set_header Cookie $http_cookie;   //请求发送时携带cookie信息
            proxy_set_header X-Real-Ip $remote_addr;
            proxy_set_header   X-Forwarded-For    $proxy_add_x_forwarded_for;
        }
        access_log logs/tomcat_access.log;
    }