1 Reply Latest reply on Apr 6, 2017 7:37 AM by pjhavariotis

    Redirect from HTTP to HTTPS in jboss eap 6.4

    utkarshjboss

      As I have already configured both HTTP and HTTPS connector in standalone.xml file and in HTTP connector I have used redirect-port="8443". So is there any thing I need to configure in jboss level to redirect from HTTP to HTTPS.

      I want to configure this redirection only at jboss level(without any web.xml of application which is deployed in jboss) and I am using JBOSS EAP 6.4.0.

      Also I want to know is there any solution to block HTTP(Only HTTPS work) for a particular application context which deployed in jboss eap 6.4.0.

      HTTP Connector

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

      HTTPS Connector

      <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>

      Any help will be greatfull

      Thanks

        • 1. Re: Redirect from HTTP to HTTPS in jboss eap 6.4
          pjhavariotis

          In order to force https requests in JBoss you can either update accordingly the app's web.xml or configure a RewriteRule.

          Since you don't want to change the web.xml of your app, you can add the following lines to the virtual-server in the web subsystem:

           

          <rewrite pattern="^/(.*)$" substitution="https://localhost/$1" flags="RL">

            <condition test="%{HTTPS}" pattern="off" />

          </rewrite>

           

          In this way, all the requests for the specific application context will be redirected to https.