代码之家  ›  专栏  ›  技术社区  ›  Julio Faerman

SSL会话迁移

  •  1
  • Julio Faerman  · 技术社区  · 14 年前

    我“按书”配置了我的Tomcat(6.0.29)集群,只使用由httpd mod_proxy_balancer(http/https)平衡的NIO HTTP连接器负载。当使用HTTP时,我可以终止服务器,并且仍然完美地使用会话。使用HTTPS时,会话在故障转移时丢失。

    任何人都有这种问题,或者可以给我一个提示,告诉我应该在哪里调试它?日志显示没有错误。我当前的连接器如下所示:

    <Connector port="8080" 
               protocol="org.apache.coyote.http11.Http11NioProtocol" 
               connectionTimeout="5000"
               maxThreads="500"
               minSpareThreads="25"
               maxSpareThreads="75"
               acceptCount="10"
               redirectPort="443"
               proxyName="www.govdigital.com.br"
               proxyPort="80" />
    

    httpd proxy.conf:

    #SSL
    LoadModule ssl_module modules/mod_ssl.so
    Listen 443
    NameVirtualHost *:443
    <VirtualHost _default_:443>
      ErrorLog logs/ssl_error_log
      TransferLog logs/ssl_access_log
      LogLevel warn
      SSLEngine on
      SSLProtocol all -SSLv2
      SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
    
      #Certificate, PK and CA Bundle
      SSLCertificateFile /srv/httpd/exported-pem.crt
      SSLCertificateKeyFile /srv/httpd/exported.key
      SSLCACertificateFile /srv/httpd/cabundle.pem
    </VirtualHost>
    
    #Proxy
    ProxyRequests Off
    ProxyPass / balancer://mycluster/ stickysession=JSESSIONID|jsessionid
    ProxyPassReverse / balancer://mycluster/
    <Proxy balancer://mycluster>
        AddDefaultCharset Off
        #Working nodes
        BalancerMember http://10.1.1.2:8080 route=worker1
        BalancerMember http://10.1.1.3:8080 route=worker2
    </Proxy>
    
    #Cache
    CacheEnable disk /decorators
    CacheEnable disk /scripts
    CacheRoot /ram/cache/
    CacheDirLevels 6
    CacheDirLength 3
    
    CacheMaxFileSize 1000000
    CacheMinFileSize 1
    
    #Agressive caching
    CacheIgnoreCacheControl On
    CacheIgnoreNoLastMod On
    CacheIgnoreQueryString Off
    CacheIgnoreHeaders None
    CacheLastModifiedFactor 0.1
    CacheDefaultExpire 3600
    CacheMaxExpire 86400
    CacheStoreNoStore On
    CacheStorePrivate On
    
    ErrorDocument 503 "Bad Servers<br/>No donuts for you"
    

    事先谢谢:)

    0 回复  |  直到 14 年前