title: HTTPS on WildFly - Redirecting from HTTP
body: <p>I have my application running on WildFly 8.2 and is supposed to be fully on HTTPS.</p>
  
  <p>To do this, on web.xml, I have</p>
  
  <pre><code>&lt;security-constraint&gt;
      &lt;web-resource-collection&gt;
          &lt;web-resource-name&gt;App&lt;/web-resource-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/web-resource-collection&gt;
      &lt;user-data-constraint&gt;
          &lt;transport-guarantee&gt;CONFIDENTIAL&lt;/transport-guarantee&gt;
      &lt;/user-data-constraint&gt;
  &lt;/security-constraint&gt;
  </code></pre>
  
  <p>And then, on standalone.xml I have, </p>
  
  <pre><code>        &lt;server name="default-server"&gt;
              &lt;http-listener name="http-default" socket-binding="http"/&gt;
              &lt;https-listener name="https-default" socket-binding="https" security-realm="SSLRealm"/&gt;
              &lt;host name="http-default" alias="localhost" default-web-module="sp.war"&gt;
                  &lt;filter-ref name="server-header"/&gt;
                  &lt;filter-ref name="x-powered-by-header"/&gt;
              &lt;/host&gt;
              &lt;host name="https-default" alias="sponline.tdata.com" default-web-module="sp.war"&gt;
              &lt;/host&gt;             
          &lt;/server&gt;
  </code></pre>
  
  <p>and </p>
  
  <pre><code>        &lt;security-realm name="SSLRealm"&gt;
              &lt;server-identities&gt;
                  &lt;ssl&gt;
                      &lt;keystore path="sponline_keystore.jks" relative-to="jboss.server.config.dir" keystore-password="sponline2015" alias="sponline" key-password="GxXxXXxX"/&gt;
                  &lt;/ssl&gt;
              &lt;/server-identities&gt;
          &lt;/security-realm&gt;
  </code></pre>
  
  <p>Now, the server is bound to 2 domain names - HQDATADEV.TDATA.COM and SPONLINE.TDATA.COM. This setup is mandated by our internal policy.</p>
  
  <p>Now, the problem is that the application is configured to have SSL on SPONLINE.TDATA.COM ONLY. But when I launch <a href="http://SPONLINE.TDATA.COM" rel="nofollow">http://SPONLINE.TDATA.COM</a> it automatically redirects me to .</p>
  
  <p>Can someone explain me this behavior? And possibly a fix for this?</p>