一、 java后端spring boot 获取requestURL()后,https变为了http!
解决:
location / {
proxy_pass http://127.0.0.1:9001;
proxy_set_header X-Forwarded-Schema https;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $clientRealip;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
spring boot 配置 server.tomcat.protocol_header=x-forwarded-proto
二、 nginx ssl后,java redirect 后,变为了http请求!
解决:
在nginx server内加入 proxy_redirect http:// https://;
版权属于:sunjianhua
本文链接:https://sunjianhua.cn/archives/nginx-ssl-problem.html
转载时须注明出处及本声明,如果不小心侵犯了您的权益,请联系邮箱:NTA2MTkzNjQ1QHFxLmNvbQ==