06-Jun-2020 22:16
Can we have iRule for non-http requests? Lets say, my VIP listens on port 9080
07-Jun-2020 03:43
Lets say following is the URL
https://www.facebook.com/BravaServer/searcg.searcgtest/872689
If [HTTP:uri] contains "BravaServer"
Then I want this to redirect to the VIP which is listening on port 9080.
Can you help me with iRule script for this?
07-Jun-2020 04:29
If URI is place is fix then try to use starts_with function to achieve goal.
Customize below irule based on your requirements. This just an Example
Option 1:
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/BravaServer" } {
HTTP::redirect "http://www.abc.com:9082/"
}
}
Option 2:
when HTTP_REQUEST {
if { [HTTP::uri] contains "BravaServer" } {
HTTP::redirect "http://www.abc.com:9082/"
}
}
Thanks
07-Jun-2020 07:40
Thank you Samir. Option 1 seems to be better one for me. Can we have pool instead of VIP.
This pool newpool_9080 is from a different VIP on the same F5.
07-Jun-2020 08:44
I will try and let you know Samir. Thank you very much.
12-Jun-2020 23:35
Hi Samir/all,
From the below mentioned iRules, Option 1 works fine, but when I try with Option 2, it doesn't work(Means, I am able to create and save the iRule, but when I associate with VIP and checking with end users to test it. Its not working as per iRule expectation. I was expecting atleast first "if" condition should work). Anything wrong with Option 2 script? When we get next Change window, I am also planning to check Option 3 irule. Is that Option3 iRule fine?
Option 1:
when HTTP_REQUEST {
if { [HTTP::uri] equals "/" } {
HTTP::redirect "https://dctm.corp.abccompany.com/D2"
}
}
Option 2
when HTTP_REQUEST {
if { [HTTP::uri] equals "/" } {
HTTP::redirect "https://dctm.corp.abccompany.com/D2"
}
elseif { [HTTP::uri] starts_with "/BravaServer" } {
HTTP::redirect "http://dctmsecondary.corp.abccompany.com:9080/BravaServer/search/searchtext/52d768ebf0179a2762d444277a17ff015ae19482ad8b24bc7712dd44dbaa627e?request.preventCache=1591756362805 status: 0"
}
else {
drop
}
}
Option 3
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/BravaServer" } {
HTTP::redirect "http://dctmsecondary.corp.abccompany.com:9080/BravaServer/search/searchtext/52d768ebf0179a2762d444277a17ff015ae19482ad8b24bc7712dd44dbaa627e?request.preventCache=1591756362805"
}
}
else {
HTTP::redirect "https://dctm.corp.abccompany.com/D2"
}
}
17-Jun-2020 00:16
expecting help from the community