【发布时间】:2015-10-08 02:00:07
【问题描述】:
我正在运行 tomcat 7 的 ec2 实例上提供内容。我将 tomcat 配置中的所有流量路由到 8443 并安装了有效证书。当我明确输入https://website.com:443 时,站点加载正常,但是当我输入http://website.com 时,它应该使用端口443 路由到https,但它使用端口8443。任何人都知道为什么会发生这种情况?我在另一台服务器上有完全相同的配置,但我有两台不想运行的新服务器。
在我的 tomcat server.xml 我有:
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
sslEnabledProtocols="TLSv1,TLSv1.1,TLSv1.2"
ciphers="TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_RC4_128_SHA,
TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA256,
TLS_RSA_WITH_AES_256_CBC_SHA,SSL_RSA_WITH_RC4_128_SHA"
keystoreFile="conf/cert.p12"
keystorePass="password"
keystoreType="PKCS12" />
在 web.xml 中:
<security-constraint>
<web-resource-collection>
<web-resource-name>Protected Context</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<!-- auth-constraint goes here if you requre authentication -->
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
【问题讨论】:
标签: ssl amazon-web-services amazon-ec2 https load-balancing