First, the basic grammar
Syntax: location [= | ~ | ~* | ^~] </uri/> {...}
Default: N/A
Scope: Server
Second, matching rules
1. Four ways to match
= Exact match
~ Case Sensitive Regular match
~* Case insensitive regular match
^~ prefix matching
2. Order of execution of location matching instructions
First: = Exact match;
Second: ^~ prefix matching;
Again: ~* and ~ Regular match, order according to the order of occurrence;
Finally: If a regular match succeeds, the regular match is used, and if there is no match, the prefix is used to match the result.
Iii. Common directives
1. Internal
Meaning: Indicates that the request must come from within, and the external request is dropped to the 404 page.
Syntax: internal;
Scope: Location
Configuration and deployment of high performance Web server Nginx (10) HTTP module location-related directives for the core module