Forum Discussion
kris_52344
Nimbostratus
Oct 13, 2010Replace http:// to https:// with i-rule
Dear all, I have a problem about it My Topology as under
client<-http-> F5-LTM <-http->Server
Here application working fine but problem is it give server ip address in http hesder
to resolve this we use followin i-rule
when HTTP_RESPONSE {
if { [HTTP::header is_redirect]} {
HTTP::header replace Location [string map -nocase {172.31.112.40 blrorsapp} HTTP::header value Location]]
}
}
It's working & provide host name insted of ip
Now User wants access application as https
client<-https-> F5-LTM<-http-> Server
if i make redirect rewrite set to all client get f5 virtual ip address in the browser insted of host name
so what changes i have to do in irule to resolve this issue
Note:- if i set redirect rewrite set to none we get page cannot be display error
- samstep
Cirrocumulus
Try SOL6912: http://support.f5.com/kb/en-us/solutions/public/6000/900/sol6912.html - hoolio
Cirrostratus
If you want to rewrite the redirects from the virtual server IP to a hostname and from http:// to https://, you can modify the string map command:when HTTP_RESPONSE { Check if response is a 30x redirect if { [HTTP::header is_redirect]} { Rewrite http:// to https:// and the IP to the hostname in the Location header value HTTP::header replace Location [string map -nocase "http:// https:// 172.31.112.40 blrorsapp" HTTP::header value Location]] } }
- kris_52344
Nimbostratus
Dear Hoolio
I try the following 2 i-rule But the problem was not solved
when HTTP_RESPONSE {
Actually the application put node ip address in the header, so if i set the rewrite redirect set to all the application is working but it shows the f5 vip in the client browser
- hoolio
Cirrostratus
Hi Kris,when HTTP_RESPONSE { Check if response is a 30x redirect if { [HTTP::header is_redirect]} { Rewrite http:// to https://, the IP to the hostname and remove the port reference in the Location header value HTTP::header replace Location [string map -nocase "http:// https:// [IP::server_addr] blrorsapp :80/ /" HTTP::header value Location]] } }
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects