title: Wildfly 9 http to https
body: <p>I want to redirect the request from HTTP to HTTPS. I am using wildfly 9. After a google search I found the following, but it is not working.
  I hope somebody </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;subsystem xmlns="urn:jboss:domain:undertow:2.0"&gt;
      &lt;buffer-cache name="default"/&gt;
      &lt;server name="default-server"&gt;
          &lt;http-listener name="default" socket-binding="http" redirect-socket="https"/&gt;
          &lt;https-listener name="https" socket-binding="https" security-realm="SSLRealm"/&gt;
          &lt;host name="default-host" alias="localhost"&gt;
              &lt;location name="/" handler="welcome-content"/&gt;
              &lt;filter-ref name="server-header"/&gt;
              &lt;filter-ref name="x-powered-by-header"/&gt;
          &lt;/host&gt;
      &lt;/server&gt;
      &lt;servlet-container name="default"&gt;
          &lt;jsp-config/&gt;
          &lt;websockets/&gt;
      &lt;/servlet-container&gt;
      &lt;handlers&gt;
          &lt;file name="welcome-content" path="${jboss.home.dir}/welcome-content"/&gt;
      &lt;/handlers&gt;
      &lt;filters&gt;
          &lt;response-header name="server-header" header-name="Server" header-value="WildFly/9"/&gt;
          &lt;response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/&gt;
      &lt;/filters&gt;
  &lt;/subsystem&gt;
  </code></pre>