Forum Discussion
ramann_75062
Nimbostratus
Apr 22, 2009Regex for URI Path List
Hi@all,
i like to create two application security classes for a virtual server, the first one have a URI path like /cgi-bin and die second one should use the rest - expect cgi-bin.
my idea is to use a regex who matche everything which is not starting with /cgi-bin/
regex:
^(!/cgi-bin/)
But this doesn't work.
Any idea what is wrong with my expression?
thanks
Bjoern
2 Replies
- hoolio
Cirrostratus
Hi Bjoern,
You can use a regex like this to match anything not starting with /cgi-bin/
http://devcentral.f5.com/Default.aspx?tabid=53&forumid=31&tpage=1&view=topic&postid=27773
(?i)^(?!/cgi-bin/).*$
Aaron - Tom_Spector_50Historic F5 Accountif you have the class catching the /cgi-bin/ as the first class in the list, then anything not caught by it will be processed by the second class - no need to actually define a specific regexp for it.
Note that there are various ways to make requests containing cgi-bin so make your regexp catch all of them (e.g. /dir1/../../cgi-bin/) also, if you want these requests to be dropped, you will need to have no pool on the class and no pool on the VS (the pool will be configured on the second class that processes the traffic). Another option would be to have a redirect to the homepage on the cgi-bin class.
Thanks,
Tom.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
