nginx-gridfs icon indicating copy to clipboard operation
nginx-gridfs copied to clipboard

Error when using regular expressions

Open bzick opened this issue 14 years ago • 2 comments

If location location ~* ^.+.(jpg|jpeg|gif|png|ico|css|js|bmp|tpl)$ { gridfs bench field=filename type=string; mongo 192.168.1.31:27000; }

Nginx return error code 500, nginx-error_log: 2010/12/14 14:00:41 [error] 28581#0: *7 Invalid location name or uri., client: 192.168.1.216, server: alpha, request: "GET /static/medium/Cloud3.jpg HTTP/1.1", host: "alpha:8081"

nginx: 0.8.52 os: Gentoo, Linux alpha 2.6.34-xen-domU #1 SMP Tue Aug 17 13:38:18 MSD 2010 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 5200+ AuthenticAMD GNU/Linux

bzick avatar Dec 15 '10 09:12 bzick

on a quick glance it looks like the problem is with the non-gridfs part of your config, hence "invalid location name or uri". I've always seen regexs written like:

location ~ ^.*$ {
}

with no "*" after the "~" - what does that do?

mdirolf avatar Dec 15 '10 14:12 mdirolf

~* is just case-insensitive matching. I'm having the same problem (without the *) - seems to only work with non-regex locations.

digitalacorn avatar Oct 19 '12 09:10 digitalacorn