Forum Discussion

Luis_Melendrez's avatar
Luis_Melendrez
Icon for Altostratus rankAltostratus
Sep 25, 2017

Allow multiple subdirectories on same irule

I would like to allow the deny some directories and block others. For example:

 

Deny /folder1/public/info /folder1/public/manage /folder1/public/ping

 

Allow /MainPage /folder1/ab/vip/* /folder1/ab/rep/* /folder1/ab/u2/* /folder1/ab/u2_reload/* /folder1/opq/* /folder1/public/*

 

Is it possible to accomplish this in one irule?

 

2 Replies

  • Hi Guy,

    Use this iRule :
    when HTTP_REQUEST {
    switch -glob [string tolower [HTTP::path]] {
    "/folder1/public/info" -
    "/folder1/public/manage" -
    "/folder1/public/ping"
    {
    discard/deny specific directories
    discard
    
    }
    "/MainPage" -
    "/folder1/ab/vip/*" -
    "/folder1/ab/rep/*" -
    "/folder1/ab/u2/*" -
    "/folder1/ab/u2_reload/*" -
    "/folder1/opq/*" - 
    "/folder1/public/*"
    {
    do nothing, allow , go ahead
    
    }
    default {
    discard rest
    discard
    }
    }
    }