Java http到https重定向(tomcat/jboss)
我们希望将所有到达应用程序http url的流量重定向到https,为此,我们在deploy/jboss-web.deployer/conf目录的web.xml中设置以下值Java http到https重定向(tomcat/jboss),java,tomcat,redirect,https,jboss,Java,Tomcat,Redirect,Https,Jboss,我们希望将所有到达应用程序http url的流量重定向到https,为此,我们在deploy/jboss-web.deployer/conf目录的web.xml中设置以下值 <security-constraint> <web-resource-collection> <web-resource-name>securedapp</web-resource-name> <url-pattern>/*
<security-constraint>
<web-resource-collection>
<web-resource-name>securedapp</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
安全DAPP
/*
保密的
这会成功地将用户重定向到https位置,但是他们使用的端口与部署/jboss-web.deployer路径中server.xml中配置的端口不同
<Connector port="8381" address="${jboss.bind.address}"
maxThreads="350" maxHttpHeaderSize="8192"
emptySessionPath="true" protocol="HTTP/1.1"
enableLookups="false" redirectPort="8543" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" compression="on" />
<!-- Define a SSL HTTP/1.1 Connector on port 8643
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="8543" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="${jboss.server.home.dir}/conf/localhost.keystore"
keystorePass="changeit"
/>
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" address="${jboss.bind.address}" protocol="AJP/1.3"
emptySessionPath="true" enableLookups="false" redirectPort="8543" />
<Engine name="jboss.web" defaultHost="localhost" jvmRoute="data1">
我们将https端口设置为8543,然后该端口正常工作。但是,当用户转到http url时,将用户重定向到的https端口为8744(当我们在server.xml中设置8744时,该端口正常工作),但是我们找不到8744端口的位置,有人知道如何配置放置在web.xml中的第一个提到的代码重定向到哪个端口吗
另一个问题是,当我们将此配置投入生产时,https端口将为“443”,我们需要知道在何处设置443,以便将“安全约束”条目重定向到。访问将不得不重定向到
问候,,
米琳达好消息是,在制作中它会很好地工作。安全约束正在发挥作用,但它被设计为仅在http(80)和https(443)之间工作 注意8744-8381=363=443-80 我正在使用JBoss-4.2.3.GA,并且观察到了相同的行为,不确定它是否还在Wildfly上这样做