For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Qasim's avatar
Qasim
Icon for Cirrostratus rankCirrostratus
Oct 03, 2019

Irule + Redirection and filter

HI,

 

Wondering if someone can help me here with an IRULE?

 

I have two hostnames but in the future the might increase as well with different backend that should be using the same VS. I need a rule that basically reflects the below:

if abc.com and url path /services1/* or /Service2/8 then pool abc_pool

if cyz.com and url path /services4/* or /Services5/* then pool xyz_pool

 

Can anyone please help me with this?

 

kind regards,

 

2 Replies

  • Hi Qasim,

    when HTTP_REQUEST {
    	switch -glob [string tolower [HTTP::host]] {
    		"abc.com" {
    			switch -glob [string tolower [HTTP::uri]] {
    				"/services1/*" -
    				"/services2/*" { pool abc_pool }
    			}
    		}
    		"cyz.com" {
    			switch -glob [string tolower [HTTP::uri]] {
    				"/services4/*" -
    				"/services5/*" { pool xyz_pool }
    			}
    		}
    		default {
    			# pool default_pool
    			# or reject
    		}
    	}
    }
    • Qasim's avatar
      Qasim
      Icon for Cirrostratus rankCirrostratus

      nice one mate. thank you very much.

       

      Regards,