|
|
|
|
|
by harshreality
5094 days ago
|
|
The type of match is made explicit before the string/pattern. "location = string" and "location string" and "location ^~ string" are non-regex matches. "location ~ pattern" and "location ~* pattern" are regex matches. Matching order is unintuitive and therefore bad, and there are plenty of other quirks with nginx configs that should be made more intuitive, but confusion between regex and non-regex is unusual. It's all described right here: http://wiki.nginx.org/HttpCoreModule#location |
|
i generally disagree with ^ being the universal "not" indicator out of context since it's a "beginning of line assertion" when not preceded by "[" within a regex. The fact that it indicates what follows is a regex-halting literal string prefix match (exactly what ^ would indicate in a normal regex) is plain confusing.
thanks