Priority of nginxlocation in configuration

location expression type ~ means to perform a regular match, case-sensitive ~* means to perform a regular match, case insensitive ^~ means an ordinary character match. Use prefix matching. If the match is successful, no other locations will be matched. = Performs an exact match on ordinary characters. That is, an exact match. @ “@” defines a named location, used when targeting internally, e.g. error_page, try_files location priority description The order of location in nginx configuration does not matter much. The type of the positive location expression is related. For expressions of the same type, longer strings will be matched first. Here are the instructions in order of priority: First priority: The equal sign type (=) has the highest priority. Once a match is found, no further matches are looked for. Second priority: ^~ type expression. Once a match is found, no further matches are looked for. Third priority: The regular expression type (~ ~*) has the second priority. If there are multiple location regular expressions that can match, the one with the longest regular expression is used. Fourth priority: regular string matching type. Match by prefix. location priority example The configuration items are as follows: location = / {…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索