多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
**正向代理代理客户端,反向代理代理服务器** ![](https://img.kancloud.cn/8b/c2/8bc24019d8ecf81a9bf1ffbdc1574fdd_1290x600.png) ![](https://img.kancloud.cn/33/d7/33d7da4258a05fd311ea177aba0e1f51_1275x527.png) #### nginx location讲解 > https://zhuanlan.zhihu.com/p/130819099 #### nginx的常用命令 > systemctl status nginx 查看状态 > systemctl start nginx 启动 > systemctl stop nginx 关闭 > systemctl restart nginx 重启 > systemctl enable nginx 开机启动 > nginx -s stop 暴力关闭 > nginx -s quit 等待剩余连接关闭后关闭 > nginx -s reload 重新加载配置 > nginx -t 检测配置文件是否正确(一般来说修改了配置文件先执行nginx -t 然后执行 nginx -s reload) #### location匹配顺序 如下规则简单总结就是优先级从高到低依次为(**序号越小优先级越高**): ~~~bash 1. location = # 精准匹配 2. location ^~ # 带参前缀匹配 3. location ~ # 正则匹配(区分大小写)ps:正则匹配是使用文件中的顺序,先匹配成功的返回。 4. location ~* # 正则匹配(不区分大小写) 5. location /a # 普通前缀匹配,优先级低于带参数前缀匹配。ps:前缀匹配下,返回最长匹配的 location,与 location 所在位置顺序无关 6. location / # 任何没有匹配成功的,都会匹配这里处理 ~~~