SpringBoot 常见小问题
经Nginx反向代理后request.getScheme()获取不到https
解决步骤如下:
在Nginx中设置请求头
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
在application.yaml中配置
server:
tomcat:
remoteip:
protocol-header: "X-Forwarded-Proto"
remote-ip-header: "X-FORWARDED-FOR"
-----------------------------------------------------------------------------------------------------------
薔薇猛虎皆成個性,陽光雨露俱是天恩!
薔薇猛虎皆成個性,陽光雨露俱是天恩!