Forum Discussion
2 different URI call to same server & different port irule creation
Hi Team,
I needs to create irule for the below request, please suggest me how to do,
Calls https://i0.test.com should to go real server with http://server01/Base/Arx/
Calls https://i0.test.com/Nas should to go real server with http://server01:8080/Nas
Hi Ramesh,
Can you try this?
when HTTP_REQUEST { if { [HTTP::host] equals "i0.test.com" } { switch -glob [HTTP::uri] { "/" { HTTP::uri "/Base/Arx" node server01-ip 80 } "/Nas" { node server01-ip 8080 } } } }
-glob: allow string pattern matching. It will loop in condition-1, Without glob it will work well.
Try this irule.. Hope it will help.
when HTTP_REQUEST { if {[HTTP::uri] starts_with "/Nas" } { HTTP::uri "/Nas" node 172.x.x.x 8080 } elseif { HTTP::uri “/Base/Arx/" node 172.x.x.x 80 } }
- TimRiker
Cirrocumulus
Replace the “/Base with "/Base
ie: wrong quote.
I'd suggest adding a "default" case as well to avoid issues with existing connections
https://devcentral.f5.com/s/articles/oneconnect-for-my-irule
- Ramesh_Babu
Nimbostratus
Given script not working getting error.
Recent Discussions
Related Content
* 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