1 Reply Latest reply on May 3, 2017 12:31 PM by brian_parker

    Redirect port 80, and 8443 to 443

    brian_parker

      I have set up standalone.xml to listen to http on port 80 and https on 443 - the default ports

       

              <socket-binding name="http" port="${jboss.http.port:80}"/>

              <socket-binding name="https" port="${jboss.https.port:443}"/>

       

      I have a redirect of the port 80 traffic to 443 via

       

                      <http-listener name="default" socket-binding="http" redirect-socket="https"/>

       

      and the following in web.xml

       

           <security-constraint>

       

                <web-resource-collection>

                   <web-resource-name>fais</web-resource-name>

                   <url-pattern>/*</url-pattern>

                 </web-resource-collection>

                 <user-data-constraint>

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

                 </user-data-constraint>

        </security-constraint>

      Entering http://webserver/webapp.jsp is redirected to https://webserver/webapp.jsp

       

      I would also like to have port 8443 traffic redirected to port 443 so that https:8443//webserver/webapp.jspp is redirected to https://webserver/webapp.jsp

       

      I have not been able to do this. I tried adding

           <http-listener name="jboss_8443" socket-binding="jboss_8443" redirect-socket="https"/>

      and

           <socket-binding name="jboss_http" port="${jboss.https.port:8443}"/>

      in standalone.xml but this did not work. When I enter https:8443/webserver/webapp.jsp the URL changes to http://0.0.32.251//webserver/webapp.jsp

       

      Can this be done?