URL access restriction

Community Forum Forums Thunder and AX Series General URL access restriction

This topic contains 1 reply, has 2 voices, and was last updated by avatar hkohn72 3 months, 1 week ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #13852
    avatar
    luca.dm
    Member

    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

    #13972
    avatar
    hkohn72
    Member

    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!

    • This reply was modified 3 months, 1 week ago by avatar hkohn72.
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

Comments are closed.