m0_37495897
m0_37495897
2017-02-10 03:27

关于https的问题,获取不到https协议

  • 关于https的问题
  • 获取不到https协议
请问jsp界面通过request.getScheme()获取协议,用https访问获取到的是http!请问如何解决
    nginx 的配置
    server 
    {
    listen       443;
    server_name www.roamingman.com;

        ssl on;
    ssl_certificate /uklrverinx/certs_roam/www.roamingman.com.crt;
    ssl_certificate_key /uklrverinx/certs_roam/www.roamingman.com.key;
    ssl_session_timeout 5m;
    ssl_protocols SSLv2 SSLv3 TLSv1;
    ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
    ssl_prefer_server_ciphers on;

    proxy_set_header   Host             $host;
    proxy_set_header   X-Real-IP        $remote_addr;
    proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for; 
    proxy_set_header X-Forwarded-Proto  $scheme;
    access_log  logs/rental.glocalme.com.log  main;
    error_log  logs/rental.glocalme.com.log.err debug;


    location / {
        index index.html index.htm index.jsp;
        proxy_pass http://10.3.65.31:8080;
        proxy_set_header   Host   $host;
        proxy_set_header   Referer $http_referer;
        proxy_set_header   Cookie $http_cookie;
        proxy_set_header   X-Real-IP  $remote_addr;
        proxy_set_header   X-Forwarded-For              $proxy_add_x_forwarded_for;
        proxy_connect_timeout 75s;
        proxy_read_timeout 300s;
        proxy_send_timeout 300s;
        proxy_redirect off;        
    }
    }

            tomcat  的配置
            <Valve className="org.apache.catalina.valves.RemoteIpValve"  
remoteIpHeader="X-Forwarded-For"  
protocolHeader="X-Forwarded-Proto"  
protocolHeaderHttpsValue="https"/> 


<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
           maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
           clientAuth="false" sslProtocol="TLS"
           keystoreFile="/ukl/httpscerts/www.roamingman.com.key"  
     />
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答

为你推荐

换一换