我正尝试将非SSL端口8080上的流量重定向到SSL端口8443(在Jboss 4.2.3.GA版本上),但它不起作用。当我在此端口上访问我的web应用程序时,它停留在该端口上并显示页面。这是我在server.xml文件从非ssl端口8080重定向到ssl端口8443
<Connector port="8080" address="${jboss.bind.address}"
maxThreads="250" maxHttpHeaderSize="8192"
emptySessionPath="true" protocol="HTTP/1.1"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true"/>
<!-- Define a SSL HTTP/1.1 Connector on port 8443
This connector uses the JSSE configuration, when using APR, the
connector should be using the OpenSSL style configuration
described in the APR documentation -->
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" keystoreFile="conf/sds/keystore"/>
配置和这里的web.xml配置
<security-constraint>
<web-resource-collection>
<web-resource-name>SUCTR</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
我一直在使用默认的端口80和443,并在网址中使用模式的具体路径尝试但仍然不起作用。我不确定我在这里做错了什么,请你指点我正确的方向。
感谢。
[此链接](HTTP:/ /www.journaldev.com/160/steps-to-configure-ssl-on-tomcat-and-setup-auto-redirect-from-http-to-https)解释了这个过程。 – Adil 2016-04-12 09:54:28
是否有可能端口号保持不变,只有重定向到https? – shzyincu 2017-04-05 09:34:17