Forum Discussion

Nuruddin_Ahmed_'s avatar
Nuruddin_Ahmed_
Icon for Cirrostratus rankCirrostratus
Dec 27, 2016

restricting urls for a virtual server

Hi, I have below setup Internet user --> Internet Firewall --> F5 --> Backend server (Pool Member)

 

I have created a virtual server on F5 with IP address 10.10.10.10 which is nattted on internet firewall with 98.98.98.98 IP address. I want this webserver to accept only connections coming for test1.abc.com and test2.abc.com, if test3.abc.com lands on this virtual server then it should be discarded.

 

2 Replies

  • Hi Nuriddin,

     

    You can use irule shown below.

     

    when HTTP_REQUEST {

     

    if {([string tolower [HTTP::host]] equals ";) || ([string tolower [HTTP::host]] equals ";)}{

     

    pool webpool

     

    }

     

    else {

     

    reject

     

    }

     

    }

     

  • You can also use the datagroup/class:

    when HTTP_REQUEST {
    if { not ([class match [HTTP::host] equals ALLOWED_DOMAINS]) } {
    reject
    }
    }
    

    ALLOWED_DOMAINS is a datagroup that contains the list of domains that can be allowed.