Forum Discussion

KOR_124005's avatar
KOR_124005
Icon for Nimbostratus rankNimbostratus
Mar 02, 2014

iRule URI

Hi All, Hope your fine,

 

i have URL with three URi http://KOR/* >>>> VS1 http://KOR/test_cc >>>> VS2 http://KOR/Prod_cc >>>> VS3

 

i have one Pool (Pool= Pool_KOR) configured with three VS.

 

i want an iRule to restrict access for each uri to each vs with same pool.

 

4 Replies

  • Restrict in terms of IP? Or do you ONLY want people to be able to access the uri's specified? You can't use the same dns record for different VS', the load balancer chooses VS by ip+port (or wildcard), not dns.
  • seconde option Or do you ONLY want people to be able to access the uri's specified thank u
  • If you want to restrict access to a specifi uri you can do something like this:

    when HTTP_REQUEST {
    
        set uri [string tolower [HTTP::uri]]
    
        if { $uri starts_with "/test_cc/" } {
            pool Pool_KOR
        } else {
            drop
        }
    } 
    

    If you want to reset the connection you can use reset instead of drop. If you want to reply with a html response you can use this instead of drop: HTTP::respond 401 Content "Access restricted."