Loadbalance a URL to 3 URLs
Hi Guys, I have a requirement like when HTTP_REQUEST { if { [HTTP::path] equals "/exampletext" it should loadbalance/roundrobin the redirection to 3 URLs shown below "https://abc1ee.xyz.com/exampletext_1" "https://abc2ee.xyz.com/exampletext_2" "https://abc3ee.xyz.com/exampletext_3" Kindly, help ! TIA725Views0likes6CommentsPool Selection Based on URI and URL Modification
I'm trying to write an iRule that will redirect traffic to different pools based on URI, as well as altering the URL to remove the URI after the traffic is redirected to the correct pool. I think I have the initial pool redirect figured out, but I can't figure out how to do that AND THEN shorten the URL. Here are my examples: https://test.test.com/url1 to pool1 then remove /url1 https://test.test.com/url2 to pool2 then remove /url2 https://test.test.com/url3 to pool3 then remove /url3 https://test.test.com/url4 to pool4 then remove /url4 https://test.test.com/ to pool5 This is what I ahve for the pool selection/redirection: when HTTP_REQUEST { switch -glob -- [string tolower [HTTP::path]] { "/url1*" { pool /Common/Pool1 return } "/url2*" { pool /Common/Pool2 return } "/url3*" { pool /Common/Pool3 return } "/url4*" { pool /Common/Pool4 return } "/*" { pool /Common/Pool5 return } } Thanks all!!610Views0likes4CommentsDetect Geo Location With iRule and Redirect
Hello, I have this iRule: when HTTP_REQUEST { if { [string tolower [HTTP::host]] contains "example.com" && [HTTP::path] eq "/" }{ set country [whereis [IP::client_addr] country] switch $country { "US" - "UK" - "CA" - { HTTP::redirect "https://example.com/${country}" } } } } The goal being to detect US, UK and CA users and then redirect them to a region specific page on the site. However with the rule enabled we just get back empty reply from F5. Turning it off or requesting example.com// (multiple trailing slashes) works. I'm thinking it has something to do with how the if statement is structure since adding additional slash characters corrects the problem but this is a bit out of my normal wheelhouse. Usually the F5 tasks I get delegated are updating SSL certificates and simple redirects.354Views0likes2CommentsF5 redirection not working
Hi Guys, Can you help me with this we are using redirection for a long time now. However not sure what is the issue on my irule. When the user enters it will be redirected to http://www.abc.com/s?rch=&q=qrs+tuv below is my irule when HTTP_REQUEST { if {[string tolower [HTTP::host]] contains "www.abc.com"} { if {[string tolower [HTTP::uri]] starts_with "/n/abc-def,-ghi-jkl/mno-2061"} { HTTP::redirect "http://www.abc.com/s?rch=&q=qrs+tuv" } } } Not sure why it is not working probably because of long uri? Please help238Views0likes2CommentsiRule to Redirect to Another VS on the same LTM
Hi guys - I'm trying to get the following scenario working: My domain "; maps to a public IP "1.1.1.1" and I have a virtual server configured on my F5 with "1.1.1.1:443" I have two unrelated applications with competing requirements running on different URIs on the same domain , one is a HR application (/abc) and the other is a inventory application (/def) I need to create a design which accomodates both applications with a single domain name, and find a way to accomodate both their conflicting requirements under the same domain name To solve this problem, I thought that I should do something like this, on the main virtual server 1.1.1.1:443, I put in an iRule with the following code: when HTTP_REQUEST { if { [string tolower [HTTP::uri]] starts_with "/abc" } { virtual VS2 } else if { [string tolower [HTTP::uri]] starts_with "/def" } { virtual VS3 } else { HTTP::respond 200 content "Unrecognised URI, please recheck your address" } } This would redirect incoming requests with "/abc" in the URI string to VS2 and incoming requests with "/def" in the URI string to VS3. Then I could create customised solutions for both applications in their respective virtual servers. So drawing this flow out, I think this is how it would look: But what I don't understand is how the Return Traffic and the Persistence Profiles work in this scenario. How do I make sure that the traffic flows this way: User to Server: User > VS1 > VS2 > Pool 2 (Server) Server to User: Pool 2 (Server) > VS2 > VS1 > User Do I do SNAT Auto Map on both VS1 and VS2 or do I just do SNAT Auto Map on VS2 with Auto Last Hop enabled? And on the question of persistence, if I intend to use source_addr persistence - I would definitely not be able to do a SNAT Auto Map on VS1, how do I then ensure that when the server responds, VS2 sends the traffic back to the user via VS1?3.6KViews0likes3CommentsNeed help to understand re-direct irule
Hi Experts !, Need your help to understand the below irule , This irule is applied to 443 VIP .Please help me to understand the impact of the below irule , when HTTP_REQUEST { if { [HTTP::uri] contains "redirect_uri=https://test-ck2-ind.example.com" } { HTTP::uri [string map {"redirect_uri=https://test-ck2-ind.example.com/" "redirect_uri=http://test-ck2-ind.example.com/"} [HTTP::uri]] } }679Views0likes4CommentsRedirect requests of all URLs except few URLs
Dear Beloved Community, I have a requirement to fulfill in LTM as below for which I need your support to provide me an iRule. Client requests containing any URIs should be redirected as below https://abc.com redirect to https://xyz.com But If client requests contains any of following URIs then do not perform redirection to https://xyz.com https://abc.com/morning OR https://abc.com/afternoon OR https://abc.com/night OR https://abc.com/school OR https://abc.com/leadership Your Sincerely611Views0likes6CommentsRedirection iRule Request for subsites
Hello I am pretty new to F5 and would like to see if someone can help me with a redirection iRule. The redirection should retain path after the second location or the subsites. So I am looking for something like: 1. when going to http://abcsp/sites/apps should be redirected to https://apps.abcsharepoint.example.com/ 2. when going to http://abcsp/sites/apps/SomethingSomething should be redirected to https://apps.abcsharepoint.example.com/SomethingSomething 3. when going to http://abcsp/Anythingotherthansites should be redirected to https://abcsharepoint.example.com/ What I have in place right looks something like this: when HTTP_REQUEST { switch -glob [string tolower [HTTP::host]] { "abcsp" { if { [HTTP::uri] starts_with "/sites/apps/" } { HTTP::redirect "https://apps.abcsharepoint.example.com/" } elseif { [HTTP::uri] starts_with "/" } { HTTP::redirect "https://abcsharepoint.example.com/" } } } } This is doing only 1 and 3. 2 is missing... Thanks in advance!366Views0likes2CommentsVS Profiles behavior when policy redirects to another VS
When I use LTM policy that redirects one vs to another how profiles assigned to virtual servers behave? Lets say I use compression profile - if I'd assign compression profile to both virtual servers will content be compressed twice or cached twice by caching profile? Of course it may be bad example because probably F5 doesn't recompress already compressed content and maybe its cache is more content aware but the point is - are profiles applied independently to each layer just as if such vs would run on another, independent physical F5? So that if I want certain profile to be applied across whole flow end-to-end do I need to assign such profile to all virtual servers on the path?227Views0likes1Commentredirect root URL to another URL
I have a public facing url cdn.mydomain.com that I need to redirect to mydomain.com if anyone goes to that site. There is nothing on the cdn website, it simply exist to feed other sites withing our environment, but has to maintain a public facing presence. The issue I have is cdn.mydomain.com is being used in several other websites for varies purposes but when I setup the redirect it break all the other sites. Below is the irule I've tried to get working. I've attempted it with just the equals "/" option but didn't change anything, other sites that call the cdn would get redirected as well. Am I missing something? when HTTP_REQUEST { if { ([string tolower [HTTP::host]] equals "cdn.mydomain.com") || ([string tolower [HTTP::host]] equals ";)} { HTTP::respond 301 Location https://mydomain.com/ } }497Views0likes0Comments