美文网首页
nginx - some notes after reading

nginx - some notes after reading

作者: 老杜振熙 | 来源:发表于2021-05-07 17:10 被阅读0次

Beginner’s Guide (nginx.org)

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 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.

相关文章

网友评论

      本文标题:nginx - some notes after reading

      本文链接:https://www.haomeiwen.com/subject/tzfedltx.html