nginx - some notes after reading doc (beginner)

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.

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容