URL access restriction

Hi all,
I’m working on a vThunder 2.7.2-P10 that is publicing many URL form a single virtual IP. Now I need to deny access from some IPs only for some URLs (not for all). For example I have 3 sites:

site1.example.com
site2.example.com
site3.example.com

And some IPs let’s say:

1.2.3.4
1.2.3.5
1.2.3.6

I need those IPs can access only on site 1 but not site2 and 3. All other IPs can access every sites. Is there a way to accomplish this?

Thanks

Luca

Hello Luca,

you solve this complexity with aFlex.
In the example below you find your solution in a simple version. I can be extended with class list and you can change the action from TCP::close to HTTP::redirect “http://site1.example.com/

aFlex: IP-Host-restriction
when HTTP\_REQUEST \{
  if \{ [IP::addr [IP::client\_addr] equals 1.2.3.0/29] \} \{
    if \{ [HTTP::host] equals "site1.example.com" \} \{
    \} else \{

TCP::close

    \}
  \}
\}

Please let me know if you need so more details.

CU hkohn!