Forum Discussion
Sulabh_Srivasta
Apr 30, 2021Cirrus
Help for setting policy /iRule
Hello All, I have a scenario where I have to use only one HTTPS Virtual server for multiple applications listening on different ports on different node, for example: There are 3 servers , Node_X, N...
- Apr 30, 2021
Hi Sulabh Srivastana,
Remove use command.
when HTTP_REQUEST { if { [HTTP::uri] starts_with "/core" } { pool Pool_X } elseif { [HTTP::uri] starts_with "/service" } { pool Pool_X } elseif { [HTTP::uri] starts_with "/ims" } { pool Pool_X1 } elseif { [HTTP::uri] starts_with "/portal" } { pool Pool_Y } elseif { [HTTP::uri] starts_with "/ords" } { pool Pool_Z } }
switch version:
when HTTP_REQUEST { switch -glob [HTTP::uri] { "/core*" - "/service*" { pool Pool_X } "/ims*" { pool Pool_X1 } "/portal*" { pool Pool_Y } "/ords*" { pool Pool_Z } } }
without using pool:
when HTTP_REQUEST { switch -glob [HTTP::uri] { "/core*" - "/service*" { node 1.2.3.4 10004 } "/ims*" { node 1.2.3.4 10009 } "/portal*" { node 5.6.7.8 10006 } "/ords*" { node 9.10.11.12 10008 } } }
Sulabh_Srivasta
Cirrus
Hi Enes,
Thanks for your response, I tried but none of the given solution is working. Please let me know if I am missing something.
May 03, 2021
Hi,
when HTTP_REQUEST {
log local0. "requri0: [HTTP::uri] - cip: [IP::client_addr]"
if { [HTTP::uri] starts_with "/core" } {
log local0. "requri1: [HTTP::uri] - cip: [IP::client_addr]"
pool Pool_X
} elseif { [HTTP::uri] starts_with "/service" } {
log local0. "requri2: [HTTP::uri] - cip: [IP::client_addr]"
pool Pool_X
} elseif { [HTTP::uri] starts_with "/ims" } {
log local0. "requri3: [HTTP::uri] - cip: [IP::client_addr]"
pool Pool_X1
} elseif { [HTTP::uri] starts_with "/portal" } {
log local0. "requri4: [HTTP::uri] - cip: [IP::client_addr]"
pool Pool_Y
} elseif { [HTTP::uri] starts_with "/ords" } {
log local0. "requri5: [HTTP::uri] - cip: [IP::client_addr]"
pool Pool_Z
}
}
Can you investigate the logs on cli and pool stats on gui?
tailf /var/log/ltm | grep requri
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