Using redirect port (for SSL) in Wildfly 8.1

Java Linux JBoss

If JBoss is running as a normal user on port 8080 and 8443 while iptables are set up to forward requests from 80 and 443 to 8080 and 8443 respectively, we may need to provide port redirection in wildfly/undertow configuration so that access to any restricted area automatically forwards to 443 instead of 8443.

From jboss-cli:

/socket-binding-group=standard-sockets/socket-binding=https-redirection:add(port=443)
/subsystem=undertow/server=default-server/http-listener=default:write-attribute(name=redirect-socket,value="https-redirection")
 
You can name socket-binding as per your needs, it doesn't has to be https-redirection.