1 Reply Latest reply: Aug 23, 2012 10:05 AM by Nicholas DiPiazza RSS

    JBoss AS7 adds :80 when building a redirect when fronted by SSL terminating load balancer

    Nicholas DiPiazza Novice

      I am having a strange problem with redirects in JBoss AS7 whereas I did NOT have these same problems in JBoss 4, 5 or 6.

       

      Here is a diagram of the servers I am using:

      network-diagram.png

      Here is a description of what is going on:

       

      1. Set up apache A 192.168.2.2 - SSL terminates here, uses mod_proxy_http to send all traffic from 443 -> Apache B's port 80
      2. Set up apache B 192.168.2.13 - No SSL here at all, simply listens on port 80 and sends traffic to JBoss AS7 through mod_jk on ajp port 8009
      3. Set up jboss as7 on 192.168.2.12 with connector:

       

      <connector name="ajp" protocol="AJP/1.3" socket-binding="ajp" scheme="https" redirect-port="443"/>

       

      I have created a very, very simple web application SimpleWebapp that has two JSP pages only:

       

      1) index.jsp 

       

      <html>

      <body>

          <% System.out.println("Preparing to redirect"); %>

          <% response.sendRedirect("test.jsp"); %>

      </body>

      </html>

       

      2) test.jsp

       

      <html>

      <body>

        It worked

      </body>

      </html>

       

      When I go to:

       

      https://192.168.2.2/SimpleWebapp

       

      Suddenly the URL becomes

       

      https://192.168.2.2:80/SimpleWebapp/test.jsp

       

      Note: The port 80, when I clearly specified redirect-port to 443. When I change the connector to scheme="ajp", then restart jboss, the redirect is even more incorrect:

       

      ajp://192.168.2.2:80/SimpleWebapp/test.jsp

       

      The redirect-port parameter seems to be completely ignored. Does anyone know what is going on here?