nginx.pid的作用:記錄nginx的main process的pid,方便kill
的調(diào)用;(因?yàn)檎{(diào)用kill
需要提供pid)
請(qǐng)求uri:請(qǐng)求uri是不包含query string的uri,比如http://localhost:8080/test/a=1
的請(qǐng)求uri指的是/test
;nginx通過(guò)請(qǐng)求uri和location進(jìn)行匹配
location的正則:其實(shí)正則就是perl規(guī)范的,只是location的正則需要以~
或~*
開(kāi)頭
location匹配規(guī)則:所有可以匹配的location中,先選有正則的location,其次再選最長(zhǎng)的location;[ = | ~ | ~* | ^~ | @]
是可以包含的前綴,各自的意義見(jiàn)nginx配置location - 簡(jiǎn)書(shū) (jianshu.com)
When nginx selects a
location
block to serve a request it first checks location directives that specify prefixes, rememberinglocation
with the longest prefix, and then checks regular expressions. If there is a match with a regular expression, nginx picks thislocation
or, otherwise, it picks the one remembered earlier.