// This will match /my-path, /my-path/other/path/index.php, /my-path/index.html
location /my-path {
. . .
}
// Exact path matching.
location = /my-path {
. . .
}
// Prevent regular expression matching from occurring if it is determined to be the best non-regular expression match.
location ^~ /my-path {
. . .
}
(none): If no modifiers are present, the location is interpreted as a prefix match. This means that the location given will be matched against the beginning of the request URI to determine a match.
=: If an equal sign is used, this block will be considered a match if the request URI exactly matches the location given.
~: If a tilde modifier is present, this location will be interpreted as a case-sensitive regular expression match.
~*: If a tilde and asterisk modifier is used, the location block will be interpreted as a case-insensitive regular expression match.
^~: If a carat and tilde modifier is present, and if this block is selected as the best non-regular expression match, regular expression matching will not take place.