Forum Discussion
skkg_111590
Nov 12, 2010Nimbostratus
need irule help
I need help as I am new to irule
When user tries to go to
1. http://abc.com/secure/* ----------it should redirect to https://abc.com./secure/* --works all fine.
when HTTP...
nitass
Nov 12, 2010Employee
Please feel free to revise.
virtual bar2-http {
snat automap
pool foo2
destination 172.28.17.120:http
ip protocol tcp
rules http-redirect
profiles {
http {}
tcp {}
}
}
virtual bar2-https {
snat automap
pool foo2
destination 172.28.17.120:https
ip protocol tcp
rules https-redirect
profiles {
clientssl {
clientside
}
http-profile {}
tcp {}
}
}
pool foo2 {
members 10.10.70.120:http {}
}
profile http http-profile {
defaults from http
redirect rewrite matching
}
rule http-redirect {
when HTTP_REQUEST {
if {[HTTP::uri] starts_with "/secure/"} {
HTTP::redirect "]"
}
}
}
rule https-redirect {
when HTTP_REQUEST {
if {not ([HTTP::uri] starts_with "/secure")} {
HTTP::redirect "]"
}
}
}
curl -I http://172.28.17.120/
HTTP/1.1 200 OK
Date: Thu, 11 Nov 2010 20:06:56 GMT
Server: Apache/2.0.59 (rPath)
Last-Modified: Thu, 11 Nov 2010 04:23:21 GMT
ETag: "1315d-5f-5580a040"
Accept-Ranges: bytes
Content-Length: 95
Content-Type: text/html; charset=UTF-8
curl -I http://172.28.17.120/secure/
HTTP/1.0 302 Found
Location: https://172.28.17.120/secure/
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
curl -Ik https://172.28.17.120/
HTTP/1.0 302 Found
Location: http://172.28.17.120/
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
curl -Ik https://172.28.17.120/secure/
HTTP/1.1 404 Not Found
Date: Thu, 11 Nov 2010 20:07:31 GMT
Server: Apache/2.0.59 (rPath)
Content-Type: text/html; charset=iso-8859-1
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