求助帖 登录成功 莫名其妙 返回302 刷新页面才能登录成功
Request URL: https://XXX.com/index
Request Method: GET
Status Code: 302 (from disk cache)
Remote Address: 39.100.118.235:443
Referrer Policy: no-referrer-when-downgrade
Cache-Control: max-age=600
Content-Length: 0
Date: Thu, 22 Aug 2019 05:50:56 GMT
Expires: Thu, 22 Aug 2019 06:00:56 GMT
Location: http://XXX.com/login;JSESSIONID=rausoibhs0j05o89hnhd9mkj4v
Server: nginx/1.16.1
Provisional headers are shown
Referer: https://XXX.com/login;JSESSIONID=rausoibhs0j05o89hnhd9mkj4v
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36
nginx 配置
server {
listen 80;
server_name XXX.com;
rewrite ^(.*) https://$server_name$1 permanent;
}
server {
listen 443 ssl;
server_name www.XXX.com;
keepalive_timeout 70;
ssl_certificate a.pem;
ssl_certificate_key a.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
location / {
proxy_pass http://localhost:8080;
# 对应端口号8088 proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $http_host;
expires 10m;
#root /opt/nodejs/deal;
#index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}