Forum Discussion
I would like clients coming requesting port 80 with /admin to be redirected to a different vs_B:8080 but by default to vs_A:80 HTTP Redirect Port
I have a problem
I would like clients coming requesting http://192.168.1.2 to be sent to virtual server vs_A (IP:192.168.1.2) and clients admin to be redirected to a different virtual server vs_B:8080 and different port. Which irule should I write to get it done.
3 Replies
- Richard__HarlanHistoric F5 Account
This should work for you
code when HTTP_REQUEST { if { [HTTP::uri] euqals "/admin" } { HTTP::redirect "http://vs_B:8080/admin } } - Makengo_134399
Altostratus
Thanks, this is working but we want external users to see http://example.genie.com/admin but not http://example.genie.com:8080/admin.
So http://example.genie.com goes to Virtual server vs_A (Pool member 192.168.1.20 port 80) http://example.genie.com/admin goes to Virtual server vs_B (Pool member 192.168.1.21 port 8080) keeping the url as it is.
- Richard__HarlanHistoric F5 AccountIn that case all you need to do is change the pool code when HTTP_REQUEST { if { [HTTP::uri] euqls "/admin" } { pool vs_B_8080 } This will change where the request is sent but not change the URL that the customer is using. Now if you have to change the URI or the Host name to make this work you can use the HTTP::uri command to change the URI or change the Host header them self.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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