Forum Discussion
mikegray_198028
Cirrus
Jan 04, 2017irule help
Hello Team,
I am using the following irule to route traffic directly to the node based uri
https://example.com/app/* > node 192.168.10.20 port 80
https://example.com/* > default pool.
...
PeteWhite
Employee
Jan 05, 2017OK, let's add some debugging logs to see what's happening:
when HTTP_REQUEST {
log local0. "Request from [IP::client_addr] URI: [HTTP::uri]"
if { [string tolower [HTTP::uri] ] starts_with "/app/" } {
node 192.168.10.20 80
HTTP::uri [string map -nocase {"/app/" "/"} [HTTP::uri]]
log local0. "Request from [IP::client_addr] URI: [HTTP::uri] matched /app"
}
}
when HTTP_RESPONSE {
log local0. "Response to [IP::client_addr] Status: [HTTP::status]"
if {[HTTP::is_redirect]} {
log local0. "Response to [IP::client_addr] original Location: [HTTP::header Location]"
HTTP::header replace Location [string map -nocase "https://example.com/test https://example.com/app/test" [HTTP::header Location]]
log local0. "Response to [IP::client_addr] modified Location: [HTTP::header Location]"
}
}
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
