Forum Discussion
Tny81
Feb 11, 2020Nimbostratus
Filter to allow certain URL/URI
Hello, I have a VIP with multiple DNS alias record tied to it. I’d like to create an irule to allow only certain traffic that matches both host and path. Any other traffic will be rejected. A...
- Feb 11, 2020
you can write iRule something below.
when HTTP_REQUEST { if { ([HTTP::host] equals "abc.com" or [HTTP::host] equals "xyz.com") } { if { [HTTP::uri] starts_with "/123/456/" || [HTTP::uri] starts_with "/cat/dog/" } { pool poo_A } else { reject } } }
OR
when HTTP_REQUEST { if { !([HTTP::host] equals "abc.com" or [HTTP::host] equals "xyz.com") && !([HTTP::uri] starts_with "/123/456/" || [HTTP::uri] starts_with "/cat/dog/") } { reject } }
Samir
Feb 11, 2020MVP
you can write iRule something below.
when HTTP_REQUEST {
if { ([HTTP::host] equals "abc.com" or [HTTP::host] equals "xyz.com") } {
if { [HTTP::uri] starts_with "/123/456/" || [HTTP::uri] starts_with "/cat/dog/" } {
pool poo_A
}
else { reject }
}
}
OR
when HTTP_REQUEST {
if { !([HTTP::host] equals "abc.com" or [HTTP::host] equals "xyz.com") && !([HTTP::uri] starts_with "/123/456/" || [HTTP::uri] starts_with "/cat/dog/") } {
reject }
}
- Tny81Feb 11, 2020Nimbostratus
Thank you Samir. I like the second option of yours and it seems to work.
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects