=
> ^~
> ~
> ~*
> /xxx
- Directives with the "=" prefix that match the query exactly. If found, searching stops.
- All remaining directives with conventional strings. If this match used the "^~" prefix, searching stops.
- Regular expressions, in the order they are defined in the configuration file.
- If #3 yielded a match, that result is used. Otherwise, the match from #2 is used.
nginx
location = / {
}
location ^~ /images/ {
}
location ~* \.(gif|jpg|jpeg)$ {
}
location /documents/ {
}
location / {
}
See also: