Forum Discussion

Darren_McMichae's avatar
Darren_McMichae
Icon for Nimbostratus rankNimbostratus
Dec 13, 2007

Pass a single port 80 page request through to a farm; redirect to https the rest

We have an issue right now with a HTTP client request to our servers. It simply won't work using the HTTPS redirect. It is a client side application problem (not a browser issue) and it will require a client side application code fix to correct.

 

 

We have (standard?) https_redirect rule applied to a port 80 farm (currently has no member pools):

 

when HTTP_REQUEST {

 

HTTP::redirect https://[HTTP::host][HTTP::uri]

 

}

 

 

and that will redirect requests to the 443 virtual server farm. This works for all requests except one. I think I need something that will inspect the request to the port 80 farm and look for the phrase 'page1.asp'. If the request is 'page1.asp' then continue passing it on to the member pool assigned to the farm (when we assign one). If the request is NOT 'page1.asp' then proceed with the https redirect.

 

 

The full URL in question is (directories changed to protect the innocent):

 

http://www.example.com/Blah1/blah2/blah3/blah4/page1.asp?FName=Transform

 

 

Here is the rule I tried to write to get this to work (using findings from other posts), but the connection to the server is reset (and attempts to tweak it haven't been successful). Neither access attempts for page1.asp or the root pages work.

 

 

when HTTP_REQUEST {

 

if {[ [HTTP::uri] exists "/page1.asp"] } then {

 

pool Client_App

 

} else{

 

HTTP::redirect https://[HTTP::host][HTTP::uri]

 

}

 

}

 

 

The Client_App is an existing pool w/ operational servers.

 

 

Thank you,

 

Darren
  • Patrick_Chang_7's avatar
    Patrick_Chang_7
    Historic F5 Account
    try

    
    when HTTP_REQUEST {
       if {[HTTP::path] contains "/page1.asp"} then {
          pool Client_app
       } else {
          HTTP::redirect https://[HTTP::host][HTTP::uri]
       }
    }
  • Thanks for your assistance. It took 3 weeks because of the holidays, but the customer was able to fit it into their scheduled for testing and it worked!