m0_37495897 2017-02-10 03:27 采纳率: 0%
浏览 4901

关于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条回答 默认 最新

  • oyljerry 2017-02-10 06:21
    关注

    你Nginx做反向代理的时候,已经转成http了。你需要填好对应的https的代理地址

     proxy_pass http://10.3.65.31:8080;
    
    
    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?