February 2018
Beginner to intermediate
348 pages
9h 40m
English
server {
server_name website.com;
location /doc {
[...] # requests beginning with "/doc"
}
location ~* ^/document$ {
[...] # requests exactly matching "/document"
}
}
You might wonder: When a client requests http://website.com/document, which of these two location blocks applies? Indeed, both blocks match this request. Again, the answer does not lie in the order in which the blocks appear in the configuration files. In this case, the second location block will apply as the ~* modifier has priority over the other.