Forum Discussion

William_Rodgers's avatar
William_Rodgers
Icon for Nimbostratus rankNimbostratus
Apr 18, 2007

HTTP redirect

My system is running fine in production, but I need to do some parallel "testing" with the production system. During one of my transactions, I get a redirect to my browswer that sends me to https://www.domain.com

 

 

Because of the location of my client I cannot intercept the 302 redirect, but my load balancer is between my client and my server. Problem is that I cannot do HTTPS for my testing, so when the client goes to connect to the server through the load balancer for this transaction, I need to rewrite:

 

 

https://www.domain.com to http://www.domain.com

 

 

I am using the normal http::host and redirect commands in my IRULEs to redirect from HTTP to HTTPS, but how do I check to see if the request starts with HTTPS since HTTP::Host does not contain the http:// or https:// stuff???

1 Reply

  • Unfortunately, the protocol (HTTP,HTTPS,etc) are not part of the HTTP spec. The only thing you have to go by is the local port (TCP::local_port).

     

     

    The easiest way is to separate HTTP and HTTPS into two virtuals with the same IP and different ports (80 for HTTP and 443 for HTTPS). This way, you can assign iRules specific for HTTP and for HTTP to their respective virtuals. Also, keep in mind that if you need to inspect HTTPS content, you will need a clientssl profile for REQUESTs and/or serversll profile for RESPONSEs.

     

     

    -Joe