After nginx completes the load, the login request repeats 302
巴扎黑
巴扎黑 2017-05-16 17:07:04
0
1
540

There are two physical hosts a and b running tomcat respectively. The operating environments are both window. Host a runs nginx, and redis is also installed on a. If redis session sharing is not used, you can log in to either machine individually, but After using redis to share, request a host, and load nginx again, the login interface will be repeated. In addition, running demo to test session sharing is no problem. Search for 302nginx solutions and add rewrite ^/(.*) http ://www.downcc.com/$1 permanent;At this time, if I request host a again192.168.1.62/czzf, it will get 404, and the browser address bar will jump to http: //127.0.0.1/czzf

    upstream czzf{
        server 127.0.0.1:8080;
        server 192.168.1.100:9038 max_fails=1 fail_timeout=30s;
    }
    
    server {
        listen       80;
        server_name  127.0.0.1;
        rewrite ^/(.*) http://127.0.0.1/ permanent;

        location / {
            root   html;
            index  index.html index.htm;
            proxy_connect_timeout 10;
            proxy_pass http://czzf;
        }
    }
巴扎黑
巴扎黑

reply all(1)
我想大声告诉你
server_name  127.0.0.1;
rewrite ^/(.*) http://127.0.0.1/ permanent;

You are already in an endless loop here.

Remove rewrite.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!