In this topic we would like to provide solution iRules check condition that match with HTTP referrer

and redirect traffic, in case not match any thing F5 will action forward traffic to specific pool

Example Diagram

F5 iRules check HTTP referrer and redirect traffic
F5 iRules check HTTP referrer and redirect traffic

iRules code

when HTTP_REQUEST {
if { [string tolower [HTTP::header value Referer]] contains “example-a” } {
HTTP::redirect “https://example.com”
} elseif { [string tolower [HTTP::header value Referer]] contains “example-b” } {
HTTP::redirect “https://example.com”
} else {
pool pool1
}
}
  1. when client sent HTTP request that match HTTP referrer value “example-a”, F5 action send back HTTP redirect traffic to “https://example.com”
  2. when client sent HTTP request that match HTTP referrer value “example-b”, F5 action send back HTTP redirect traffic to “https://example.com”
  3. In case not match anything, F5 forward traffic to specific pool “pool1”

 2,795 total views,  28 views today

Related Posts

  • I would like to provide F5 iRule that check HTTP host and uri for forward to select pool, So i think some use case or application service requirement we have to use solution iRules to check condition HTTP header for forward to select pool (Servers) when HTTP_REQUEST {set httphost [string…
    Tags: pool, http, forward, irules, check, networks
  • In this topic about solution F5 using iRules to check source client IP address from HTTP header x-forward-for and f5 query IP address from x-forward-for to geo-database for check country name, In case match with blacklist country, F5 action drop packet from client Step1: Diagram Traffic flow for this case…
    Tags: client, irules, check, http::header, match, case, traffic, networks
  • In this topic, we would like to provide example IRULES for function F5 GTM/LTM that check domain and select pool, This solution help you for scenario F5 implement front of DNS server when DNS_REQUEST {if {[DNS::question name] contains "example.com" } {pool Poolname}
    Tags: irules, check, pool
  • In this topic, we would like to provide example IRULES for function F5 LTM that check HTTP uri and select pool, This solution help you to manage HTTP Traffic and forward traffic to pools In this example IRULES below, when users request with www.test.com/example1234, F5 detect HTTP uri = example1234…
    Tags: http, irules, pool, traffic, forward, check, match, request
  • This topic we would lile to provide information and step how to setup F5 iRules that check source client ip and translate client ip addtess before send traffic to servers Diagram In this diagram above, We have client IP a.a.a.a, b.b.b.b and c.c.c.c send traffic to virtual server on F5,…
    Tags: irules, client, traffic, send, pool, match, check, networks

Categories:

Tags:

No responses yet

Leave a Reply

Your email address will not be published.