How to catch a request that has a given word in url?

Fernando Perez lists at ruby-forum.com
Mon Aug 9 13:16:53 MSD 2010


Hi,

I am trying to catch any request that has WORD in the url, eg:

catch: http://example.org/whatever/path/WORD/file.pdf

don't catch: http://example.org/some/other/path/anotherfile.jpg

and if simple to do, don't catch: http://example.org/folder/WORD.doc


I tried:

location ^~ /WORD/ {}

location WORD {}

location ~* WORD {}


But none seemed to do want I want*.

Thanks for your advice :)


*: unless I'm hitting again this stupid caching thing, but this time I
tried in safari and it didn't work either, so it should be cleared.
-- 
Posted via http://www.ruby-forum.com/.



More information about the nginx mailing list