Nginx服务器中的location配置详解

2019-10-17 20:03:52丽君

6. @
用于定义一个 Location 块,且该块不能被外部 Client 所访问,只能被 Nginx 内部配置指令所访问,比如 try_files or error_page

演示实例

2015817110941677.png (1022×554)

产生的效果如下:
访问根目录/,匹配到location /
访问除hello.php之外的其它php程序,匹配到location ~ .php$,并且用php5-fpm去运行
访问hello.php,匹配到location = /hello.php,访问被重定向到好联系官网