client redirection from http to https

Hi,

I’ve the following problem to solve :

Client must come in HTTPS to the BIG-IP and BIG-IP → Server in HTTP. My Virt server is in HTTPS.

We would like that any client coming with http://www.acb.com that the BIG-IP respond to the client to uses https://www.abc.com

Something like that :

If http_request = http://www.abc.com

then HTTP response = https://www.abc.com

Somebody could help me to translate that in an Irules…?

Thanks a lot in advance.

Nick

Hi,

You can do something like this:

when HTTP_REQUEST { 
   HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri] 
 }

Hello,

Works fine.

Thx :wink:

Also, there’s a freebie tool for generating redirection iRules of all sorts here:

http://devcentral.f5.com/Default.aspx?tabid=63&articleType=ArticleView&articleId=233