4 Replies Latest reply on Feb 23, 2015 11:55 AM by Hong Shao

    How to redirect http to https with port forwarding

    Hong Shao Newbie

      Hi, I'm upgrading our app server from 4.2.3 to Wildfly 8.2. Here's my setup:

       

      WildFly 8.2

      Linux - Ubuntu 12.4

      http - port 8080

      https - port 8443

      and use iptables to forward port 80 -> 8080, 443 -> 8443

       

      I have some resources that need to be forwarded to HTTPS if the visitor uses port 80 in the browser, so I added this block to my web.xml:

      <user-data-constraint>

                  <transport-guarantee>CONFIDENTIAL</transport-guarantee>

      </user-data-constraint>

       

      However, the server redirects the page to https://<myresource>:8443, instead of https://<myresource>:443.

       

      Is there a way to make this redirect to the correct port without writing my own custom handler? I'm comfortable to write custom code if I have to, but it would be nice if there's a configuration to accomplish this that I am not aware of.

       

      Thanks very much!

       

      Hong