Forum Discussion
Block specific URL's in APM
we have requirement to block particular URL's and URI.
can we block URL and URI in the APM provisioned F5 device.
Thanks,
RK
5 Replies
Yes you can, even with just LTM
try something like this
when HTTP_REQUEST { switch -glob [ string tolower [HTTP::uri] ] { "/uri1" - "/uri2" { drop } default {} } }Hi rkram_p,
if you really want to use APM, you could use Per-Request Polices. Do as Kostas said, use iRules instead.
Cheers
Daniel- rkram_p
Altostratus
Hi Injeyan_Kostas ,
Thank you for your response. can we use same format for to block whole URL?
Thanks
RK
you can try somthing like this
when HTTP_REQUEST { switch -glob [ string tolower [HTTP::host] ] { "test.example.com" { switch -glob [ string tolower [HTTP::uri] ] { "/uri1" - "/uri2" { drop } default {} } } "test2.example.com" { switch -glob [ string tolower [HTTP::uri] ] { "/uri3" - "/uri4" { drop } default {} } } default {} } }
- Jonathancert
Cirrus
You can also use Local Traffic Policy. I try to only use iRule if a Local Traffic Policy can not be effective. Less CPU cost.
GUI path: Local Traffic → Policies → Policy List → Create
Use these settings:
- Name: block_specific_url
- Strategy: first-match (recommended for deterministic behavior)
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