【问题标题】:Tomcat SSL-tracking-mode with nginx带有 nginx 的 Tomcat SSL 跟踪模式
【发布时间】:2017-11-27 07:01:08
【问题描述】:

我想通过使用 tomcat 提供的 SSL 跟踪模式来使用会话跟踪。 tomcat 位于 apache 服务器或 nginx 服务器后面,通过 ssl 与客户端通信。

问题是:只要 Tomcat 配置了 SSL,nginx 就不会重定向到它。

nginx服务器目前是这样配置的。

server {
    listen       443 ssl;
    server_name  localhost;

    ssl_certificate      cert.pem;
    ssl_certificate_key  key.pem;

    ssl_session_cache    shared:SSL:1m;
    ssl_session_timeout  5m;

    ssl_ciphers  HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers  on;
   location / {
                proxy_ssl_server_name on;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-NginX-Proxy true;
    proxy_ssl_session_reuse off;
    proxy_set_header Host $http_host;
    proxy_redirect off;
       proxy_pass https://127.0.0.1:8443/;

    }

}

Tomcat被配置为

    <Connector
       protocol="org.apache.coyote.http11.Http11NioProtocol"
       port="8443" maxThreads="200"
       scheme="https" secure="true" SSLEnabled="true"
       keystoreFile="${user.home}/.keystore" keystorePass="changeit"
       clientAuth="false" sslProtocol="TLS"/>


    <Valve className="org.apache.catalina.valves.RemoteIpValve"
       remoteIpHeader="x-forwarded-for"
       remoteIpProxiesHeader="x-forwarded-by"
       protocolHeader="x-forwarded-proto"/>

所以我有几个问题:

是否可以在 http 服务器后面使用基于 SSL 的跟踪? 需要特殊的连接器吗?

【问题讨论】:

    标签: tomcat ssl nginx https


    【解决方案1】:

    请尝试使用 AJP 连接器,然后您的前端将转发您需要的这些信息(SSL 会话等)。为此,您还需要更改前端的 proxypass 以使用 ajp 协议。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-08-07
      • 1970-01-01
      • 1970-01-01
      • 2016-05-06
      • 1970-01-01
      • 2017-07-27
      • 2021-03-14
      • 1970-01-01
      相关资源
      最近更新 更多