Forum Discussion
A__N_5261
Nimbostratus
Feb 02, 2012https Redirect
Hi All,
We have irule which redirecting to HTTPS. when i apply to HTTP VS . it give erro http profile should be configure
Why we have attach http profile. What is use of it ...
nitass
Employee
Feb 02, 2012i agree with nathan. http profile and irule seem to be the most straight way to achieve this. anyway, if you can't use http profile, you have to collect tcp payload, parse http header and response manually.
e.g.
[root@ve1023:Active] config b virtual bar list
virtual bar {
destination 172.28.19.79:80
ip protocol 6
rules myrule
}
[root@ve1023:Active] config b rule myrule list
rule myrule {
when CLIENT_ACCEPTED {
TCP::collect
}
when CLIENT_DATA {
set uri [findstr [TCP::payload] "GET " 4 " "]
set host [findstr [TCP::payload] "Host: " 6 "\r\n"]
TCP::respond "HTTP/1.0 302 Found\r\nLocation: https://$host$uri\r\nConnection: Keep-Alive\r\nContent-Length: 0\r\n\r\n"
TCP::release
}
}
[root@ve1023:Active] config curl -i http://172.28.19.79/whatever
HTTP/1.0 302 Found
Location: https://172.28.19.79/whatever
Connection: Keep-Alive
Content-Length: 0
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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