Web HttpServletRequest的getRequestURL方法獲取不到https協議請求問題

須要再nginx裏面配置好對應ssl以及把證書放到對應位置
例如:html

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.xmlnginx

找到70行,默認位置修改成:tomcat

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

重啓tomcat便可bash

相關文章
相關標籤/搜索