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