nginx - some notes after reading doc (beginner)

Beginner’s Guide (nginx.org)

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, remembering location with the longest prefix, and then checks regular expressions. If there is a match with a regular expression, nginx picks this location or, otherwise, it picks the one remembered earlier.

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

推薦閱讀更多精彩內(nèi)容