Forum Discussion

arjun_ankathil_'s avatar
arjun_ankathil_
Icon for Nimbostratus rankNimbostratus
Apr 07, 2010

Http redirection for specific URL and HTTP to HTTPs redirection

Hi ,

 

 

We have a situation where we have HTTPs for specific Virtual server, We have certain URLs under that VS which works only on HTTP, and we need HTTP to HTTPS redirection expect those URLs.

 

 

Please help me with a irule.

4 Replies

  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    Hi Arjun,

     

     

    Can you explain a bit more on why you only want to have some URIs requested via HTTP?

     

     

    Are you decrypting HTTPS traffic on LTM using a client SSL profile and then passing the traffic to the pool members via HTTP? If so, all traffic to the pool members should be unencrypted.

     

     

    Thanks,

     

    Aaron
  • my problem is that I have 2 VS's, one for HTTP and one for HTTPS. Now, the HTTP VS originally had a blanket redirect HTTP>HTTPS, but now there are 2 sub domains that need to be HTTP.

     

     

    They are:

     

    http://blah.com/test/site1

     

    http://blah.com/test/site2

     

     

    So I need all traffic to be redirected to HTTPS except for the above sites. Any idea how I get this going as I have been pulling my hair out all day?

     

     

     

     

     

  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    Hi Nick,

    You can use an iRule like this to selectively redirect HTTP requests to HTTPS:

    
    when HTTP_REQUEST {
       switch [string tolower [HTTP::path]] {
          "/test/site1" -
          "/test/site2" {
              Do nothing so the request will be sent to the VIP's default pool
          }
          default {
             HTTP::redirect "https://[HTTP::host][HTTP::uri]"
          }
       }
    }
    

    Aaron