What is the meaning of the tilde after the location block in the nginx configuration?
for example
location ~ ^/download/(.*)$ {
alias /home/website/files/$1;
}
What is the difference between with and without the "~"
?
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.
Sign up to join this communityWhat is the meaning of the tilde after the location block in the nginx configuration?
for example
location ~ ^/download/(.*)$ {
alias /home/website/files/$1;
}
What is the difference between with and without the "~"
?
The tilde instructs nginx to perform a case-sensitive regular expression match, instead of a straight string comparison.
More details in the docs.
~*
modifier for case-insensitive reg exp matching and ^~
modifier to override possible matches elsewhere.
Nov 20, 2020 at 18:51