Forum Discussion
SimonaPanzica_2
Nimbostratus
Jun 30, 2015redirect traffic based on x-forwarded-host
Hi,
I have a service that writes x-forwarded-host headers inside the HTTP packets and I need to intercept all the packets coming to the Big-IP with a specific X-Forwarded-Host name and redirect it to a specific pool. How will the iRule look like?
Thanks
2 Replies
- Michael_Jenkins
Cirrostratus
a basic iRule to accomplish that might look something like this:
when HTTP_REQUEST { if { [HTTP::header exists "X-Forwarded-Host"] } { switch [HTTP::header value "X-Forwarded-Host"] { "example.com" { pool abc" } "example1.com" - "example2.com" { pool "xyz" } default { Do nothing or set default pool } } } } - SimonaPanzica_2
Nimbostratus
Thanks Michael, I'll test it and let you know.
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