Forum Discussion
F5 iRUule not working
- Jun 19, 2023
[edit] Ignore this, ScottE had the proper advice below 🙂
What's not working for you exactly - what behaviour are you seeing?
I did a quick test in the lab and I see the behaviour you'd expect (a 302 redirect) - obviously I've set the IP for mule-dev-openai-lb.ucsf.edu to the VIP in my lab here:
$ curl -kv 'http://mule-dev-openai-lb.ucsf.edu/tccog2/openai/deployments/tccognitivedeployment/completi ons?api-version=2022-12-01' * Trying 10.10.16.10:80... * Connected to mule-dev-openai-lb.ucsf.edu (10.10.16.10) port 80 (#0) > GET /tccog2/openai/deployments/tccognitivedeployment/completions?api-version=2022-12-01 HTTP/1.1 > Host: mule-dev-openai-lb.ucsf.edu > User-Agent: curl/7.81.0 > Accept: */* > * Mark bundle as not supporting multiuse * HTTP 1.0, assume close after body < HTTP/1.0 302 Moved Temporarily < Location: https://tccog2.openai.azure.com/tccog2/openai/deployments/tccognitivedeployment/completions?api-version=2022-12-01 < Server: BigIP * HTTP/1.0 connection set to keep alive! < Connection: Keep-Alive < Content-Length: 0 < * Connection #0 to host mule-dev-openai-lb.ucsf.edu left intact
Hello msaud
For source link: https://mule-dev-openai-lb.ucsf.edu/tccog2/openai/deployments/tccognitivedeployment/completions?api-version=2022-12-01
HTTP::path (path and filename in request) = /tccog2/openai/deployments/tccognitivedeployment/completions
so the following test
if { [HTTP::path] equals "/tccog2" } {
will not be true. Hopefully you can change that "equals" to "starts_with" and then you should be able to get to your setting of the newUri. If that is not behaving then you can log the current uri and the newUri to see ensure it is behaving as expected.
Scott
Hi Scotte,
Thank you for your support on this. I did try below as well but still not working.
when HTTP_REQUEST {
if { [HTTP::host] equals "mule-dev-openai-lb.ucsf.edu"} {
if { [HTTP::path] starts_with "/tccog2" } {
set newUri [string range [HTTP::uri] [string first / [HTTP::uri] 1] end]
set HTTP::uri ${newUri}
HTTP::redirect "https://tccog2.openai.azure.com[HTTP::uri]"
}
}
}
- AaronJBJun 19, 2023SIRT
[edit] Ignore this, ScottE had the proper advice below 🙂
What's not working for you exactly - what behaviour are you seeing?
I did a quick test in the lab and I see the behaviour you'd expect (a 302 redirect) - obviously I've set the IP for mule-dev-openai-lb.ucsf.edu to the VIP in my lab here:
$ curl -kv 'http://mule-dev-openai-lb.ucsf.edu/tccog2/openai/deployments/tccognitivedeployment/completi ons?api-version=2022-12-01' * Trying 10.10.16.10:80... * Connected to mule-dev-openai-lb.ucsf.edu (10.10.16.10) port 80 (#0) > GET /tccog2/openai/deployments/tccognitivedeployment/completions?api-version=2022-12-01 HTTP/1.1 > Host: mule-dev-openai-lb.ucsf.edu > User-Agent: curl/7.81.0 > Accept: */* > * Mark bundle as not supporting multiuse * HTTP 1.0, assume close after body < HTTP/1.0 302 Moved Temporarily < Location: https://tccog2.openai.azure.com/tccog2/openai/deployments/tccognitivedeployment/completions?api-version=2022-12-01 < Server: BigIP * HTTP/1.0 connection set to keep alive! < Connection: Keep-Alive < Content-Length: 0 < * Connection #0 to host mule-dev-openai-lb.ucsf.edu left intact
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