HttpServletRequest的getRequestURL方法获取不到https协议请求问题

HttpServletRequest的getRequestURL方法获取不到https协议请求问题

需要在nginx里面配置好对应ssl以及把证书放到对应位置
例如:

listen 443;
 server_name xxx.xxxx.com;
 ssl on;
 root html;
 index index.html index.htm;
 ssl_certificate cert/123456xxxxxx.pem;
 ssl_certificate_key cert/123456xxxxxx.key;
 ssl_session_timeout 5m;
 ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
 ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
 ssl_prefer_server_ciphers on;

 配置完成后修改tomcat,/conf/server.xml

找到70行,默认位置修改为:

<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
scheme="https"
redirectPort="8443" proxyPort="443" />

 重启tomcat即可

posted @ 2021-02-03 14:52  *乐途*  阅读(1829)  评论(0)    收藏  举报