To summarize, the order in which directives are checked is as follows:express
1,Directives with the "=" prefix that match the query exactly. If found, searching stops.this
2,All remaining directives with conventional strings. If this match used the "^~" prefix, searching stops.rem
3,Regular expressions, in the order they are defined in the configuration file.string
4,If #3 yielded a match, that result is used. Otherwise, the match from #2 is used.it
我的总结:io
1,普通匹配的表达式不能重复,正则匹配的表达式不能重复(不一样的修饰符能够重复,好比~和~*)sed
2,正则匹配:要有~(大小写敏感)获取~*(大小写不敏感) 普通匹配:^~或=或空file
3,最大前缀匹配,uri要尽可能匹配更多的前缀yield
4,普通匹配没有编辑的顺序,正则有总结
5,正则location让位于=和^~,覆盖其余的普通location