Forum Discussion
Need irule to block the traffic based on specific http parameters.
Hi
Need help in creating an irule for a VIP block android user agents. these users are causing load. need to block based on site id parameter and user agent. To be specific a useragent with specific site ID has to be blocked.
4 Replies
- jgranieri
Nimbostratus
there are two ways to do this. one is to use datagroups in the irule and use class match statements. in the datagroups specify the strings u want to match on. below is the straigh irule reference u can either use a pool as an action or simply add a reject statement then and default for all other actions
when HTTP_REQUEST { if { ( [string tolower [HTTP::uri]] contains "/testconnect/") && ( [string tolower [HTTP::header User-Agent]] starts_with "java/" ) } { pool _something } else { HTTP::respond 200 content "not allowed..." reject } } - Stefan_Klotz
Cumulonimbus
Hi Rajesh,
can you provide an example request? I mean where is the site ID located? Is this part of the URI, a query parameter, a header or cookie value? And what's the exact name of it?
Ciao Stefan :)
- Stefan_Klotz
Cumulonimbus
Hi Rajesh,
you still forgot to mention the exact name of the header or query parameter or section in the URI, where to look for.
Ciao Stefan :)
- Stanislas_Piro2
Cumulonimbus
Hi,
are you sure "Site ID" is the header name?
I never saw a header name with space...
As requested Stefan, can you provide an example of the request? because, you are talking about parameter, header name... with is not the same.
when requesting
the request is:http://www.company.com/path?q=test&lang=enGET /path?q=test&lang=en HTTP/1.1 Host: www.company.com user-agent: Mozilla...in this request:
- URI is /path?q=test&lang=en
- path is /path
-
parameters:
- q with value test
- lang with value en
-
headers:
- Host with value www.company.com
- user-agent with value Mozilla...
So, what do you want to filter?
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com