Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

"map $url" does not work instead of "if $url"

$
0
0
This configuration works:

if ($uri ~ "/(apple|banana|orange)/") {
set $nocache 1;
}

However this does not work:

map $uri $nocache {
default 0;
~^/(apple|banana|orange)/ 1;
}

I prefer using map for performance reasons, furthermore "if is evil". Would you point me to the right direction to improve the map statement?

Viewing all articles
Browse latest Browse all 4759

Trending Articles