nginx中location有几种:
1.前缀,可以有=或^~修饰,比如
location / /开头的
location /img/ /img/开头的
location = /a.htm 刚好/a.htm
location ^~ /d 匹配后不再检查正则表达式location
2.正则表达式,固定~或~*(不区分大小写)开头,比如:
location ~ \.html$
location ~* \.gif$
同时有多个location时,优先级如下:
1.Test the URI against all prefix strings.
和所有前缀比较没有正则匹配,则使用刚才最长前缀
以上就介绍了nginx location优先级详解,包括了location,nginx方面的内容,希望对PHP教程有兴趣的朋友有所帮助。
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号