Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 
Custom Alert Banner

restricting urls for a virtual server

Nuruddin_Ahmed_
Cirrostratus
Cirrostratus

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 2

TayF5un
Nimbostratus
Nimbostratus

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

 

}

 

}

 

Vijay_E
Cirrus
Cirrus

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.