0 Replies Latest reply on Dec 15, 2010 3:02 PM by nick.x.newman

    Can I control the Protocol generated by sendRedirect?

    nick.x.newman

      Hi,

       

      I have a JBoss 6 server behind a "content switch" that acts as a front end and a termination point for HTTPS.  So the flow is:

       

      • Client's browser makes an HTTPS request to the front end. Let's call this machine FrontEnd
      • Front end makes an HTTP request to JBoss.  Let's call this machine AppServer

       

      This seems to work fine until the application requests a redirect to a relative address.  In that case JBoss converts the relative URL to an absolute URL of the form

       

      HTTP://FrontEnd/... 

       

      and this breaks things because I need the URL to be

       

      HTTPS://FrontEnd/...

       

      Actually I was surprised that JBoss even put "FrontEnd" in there.  How did it know not to use "AppServer"?  So I investigated (using JBoss' RequestDumperValve) and found that the content switch (FrontEnd) adds some headers, including the following ones that seem especially relevant:

       

      sch
      eme=http
      • scheme=http
      • serverName=FrontEnd

       

      So with that information I can see why JBoss is doing what it does.  My question (finally!) is, can I somehow persuade JBoss to use HTTPS in the redirect under these conditions?

       

      (I'm hoping for some simple configuration setting rather than writing a valve or modifying the content switch).

       

      Many thanks,

      NIck