问题出在nginx反向代理配置,大部分nginx反向代理配置如下:
server{
listen 80;
server_name www.aa.com www.bb.com;
location / {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade-Insecure-Requests 1;
proxy_set_header X-Forwarded-Proto https;
}
}
把location / {改成location ~ .* {就可以了。