nginx.pid的作用:记录nginx的main process的pid,方便kill的调用;(因为调用kill需要提供pid)
请求uri:请求uri是不包含query string的uri,比如http://localhost:8080/test/a=1的请求uri指的是/test;nginx通过请求uri和location进行匹配
location的正则:其实正则就是perl规范的,只是location的正则需要以~或~*开头
location匹配规则:所有可以匹配的location中,先选有正则的location,其次再选最长的location;[ = | ~ | ~* | ^~ | @]是可以包含的前缀,各自的意义见nginx配置location - 简书 (jianshu.com)
When nginx selects a
locationblock to serve a request it first checks location directives that specify prefixes, rememberinglocationwith the longest prefix, and then checks regular expressions. If there is a match with a regular expression, nginx picks thislocationor, otherwise, it picks the one remembered earlier.