February 2018
Beginner to intermediate
348 pages
9h 40m
English
Nginx allows you to define location blocks by specifying a pattern that will be matched against the requested document URI:
server {
server_name website.com;
location /admin/ {
# The configuration you place here only applies to
# http://website.com/admin/
}
}
Instead of a simple folder name, you can indeed insert complex patterns. The syntax of the location block is:
location [=|~|~*|^~|@] pattern { ... }
The first optional argument is a symbol called location that will define the way Nginx matches the specified pattern and also defines the very nature of the pattern (a simple string or regular expression). The following paragraphs detail the different modifiers and their behavior.
Read now
Unlock full access