Forum Discussion

mwant29_130667's avatar
mwant29_130667
Icon for Nimbostratus rankNimbostratus
Jul 26, 2013

HTTP to HTTPS redirect

I have been unable to get a HTTP redirect working. I have tried an iRule and also a HTTP Class Profile. I have 2 virtual servers on the same VIP, one on 80 and the other on 443. I have used Firefox to look at the response and I see nothing coming back. I have used the standard redirect for the irule as follows...

 

 

when HTTP_REQUEST {

 

HTTP::redirect ]

 

}

 

and the following for the Class Profile..

 

 

[HTTP::host] ":" 1][HTTP::uri]

 

 

Can anyone help here?

 

4 Replies

  • I have used Firefox to look at the response and I see nothing coming back.can you try curl?

    e.g.

    [root@ve10:Active] config  b virtual bar list
    virtual bar {
       snat automap
       destination 172.28.19.252:80
       ip protocol 6
       rules myrule
       profiles {
          http {}
          tcp {}
       }
    }
    [root@ve10:Active] config  b rule myrule list
    rule myrule {
       when HTTP_REQUEST {
      HTTP::redirect https://[HTTP::host][HTTP::uri]
    }
    }
    
    [root@ve10:Active] config  curl -I http://172.28.19.252/something
    HTTP/1.0 302 Found
    Location: https://172.28.19.252/something
    Server: BigIP
    Connection: Keep-Alive
    Content-Length: 0
    
    
  • Thanks for the feedback nitass but that is way beyond my knowledge of BIGIP's at the moment to execute that.
  • mwant, just copy and paste the curl command that nitass shows above. the curl libraries/commands are installed as part of the base os. A more graphical alternative would be to download httpwatch (free version) from www.httpwatch.com and capture the transaction. It should become clear very quickly what is happening and should be easy to resolve.

     

     

    Just screenshot it and post it. I don't recall if we can submit images to the board though. If not, send the image to marco_octavian - at yahoo and I'll take a quick look at it. I can then post the results back into the forum for other users to learn from.
  • I managed to fix this by chance, I had wrongly configured an SSL client profile on the port 80 VS, as soon as i took it off it started working. Doh!

     

     

    Thanks for the further info Marco, it is easier than it sounded. I will remember that for the future