2017-04-05 107 views
2

由于我已经在standalone.xml文件和HTTP连接器中配置了HTTP和HTTPS连接器,所以我使用了redirect-port="8443"。 因此,我需要在jboss级别配置为从HTTP重定向到HTTPS。如何在jboss eap 6.4中将HTTP重定向到HTTPS 6.4

我要配置此重定向仅在JBoss的水平(没有它部署在JBoss应用的任何web.xml)中,我使用JBoss EAP 6.4.0

另外我想知道有没有什么解决办法阻止部署在jboss eap 6.4.0中的特定应用程序上下文的HTTP(仅HTTPS工作)。仅在JBOSS Config级别。

HTTP连接器

<connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http" 
      redirect-port="8443"/> 

HTTPS连接器

<connector name="https" protocol="HTTP/1.1" scheme="https" socket-binding="https" 
      enable-lookups="false" secure="true"> 
    <ssl name="ssl" key-alias="XXX" password="******" 
     certificate-key-file="${jboss.server.config.dir}/xxx.jks" protocol="TLSv1" 
     verify-client="false"/> 
</connector> 

任何帮助是很大的

感谢

回答

0

对于问题的第二部分:如何通过http为特定应用程序停止访问可以通过在JBOSS应用程序服务器上定义的VirtualHost定义完成,并使用jboss-web.xml将应用程序绑定到该主机。

<jboss-web> 
    <context-root>/</context-root> 
    <virtual-host>www.mydot.com</virtual-host> 
</jboss-web> 

参考:

JBOSS-AS :Chapter 7. Setting up Virtual Hosts

+0

感谢您的回答,但我只希望在JBoss的配置水平做到这一点。 –