Forum Discussion
irule not working
I am using the below irule in the WIP and the outcome expected is when the extension is exp it should direct to specific IP address and respectively for other extension . I am able to see increase in total execution every time I try to access the WIP but not able to see the desired out put on the tcpdump . The packet is not getting translated to a.b.c.d:8082 and respectively for other requests .
HTTP_REQUEST { when HTTP_REQUEST { if { [HTTP::uri] contains "/exp" } { log local0. "Sending request to exp" HTTP::respond 301 "Location" "https://a.b.c.d:8082/exp"; } elseif { [HTTP::uri] contains "/proc" } { log local0. "Sending request to proc" HTTP::respond 301 "Location" "https://a.b.c.d:8080/proc"; } elseif { [HTTP::uri] contains "/sys" } { log local0. "Sending request to sys" HTTP::respond 301 "Location" "https://a.b.c.d:9043/sys"; } }
Hi Subhasish Pratihar,
the command
will send a HTTP response to the clients informing them that the resource has been "Moved Permanently" to the new locationHTTP::respond 301 "Location" "https://a.b.c.d:8082/exp"
.https://a.b.c.d:8082/exp
The clients will send then a new request directly to the URL
and should also cache the new location locally, so that subsequent request will be redirected within the browser without sending any traffic to the old location...https://a.b.c.d:8082/exp
Is this what you are trying to accomplish? I'm asking because lots of users are getting confused with terms "redirect to a different site" and "forward the ongoing request to a given backend pool".
Cheers, Kai
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