nginx: [emerg] duplicate location “/“ in /usr/local/etc/nginx/nginx.conf:142

nginx: [emerg] duplicate location “/“ in /usr/local/etc/nginx/nginx.conf:142

启动 Nginx 的时候报这个错,是因为在同一个 server 中重复定义了 location / 匹配协议,需要删除一个。后面的 :142 就是行号,找到这一行去检查,然后注释或者合并为一个即可。

nginx配置出错duplicate location “/”nginx: [emerg] duplicate location “/”

将nginx配置文件中的两个location合并成一个 就好了。 server { listen ******; listen *****; server_name ****; root /*****; location / { index index.php index.html ind...

Nginx企业级Web服务实战

11 课时 |
655 人已学 |
免费

Linux Web服务器Nginx搭建与配置

5 课时 |
13872 人已学 |
免费
开发者课程背景图

配置 nginx server 出现nginx: [emerg] "root" directive is duplicate in /etc/nginx/server/blogs.conf:107

在配置nginx 虚拟机时,执行 sudo /usr/sbin/nginx -t 报下面的错误: nginx: [emerg] "root" directive is duplicate in /etc/nginx/server/blogs.conf:107 nginx: configuration...

本页面内关键词为智能算法引擎基于机器学习所生成,如有任何问题,可在页面下方点击"联系我们"与我们沟通。

产品推荐

{"cardStyle":"productCardStyle","productCode":"aliyun","productCardInfo":{"productTitle":"部署Nginx并通过Ingress暴露和监控服务","productDescription":"在阿里云容器服务(后简称ACK)集群中通过YAML文件快速部署一个Nginx应用并通过Nginx Ingress暴露和监控服务,结合使用ACK、日志服务、专有网络搭建业务部署运维方案。","productContentLink":"https://www.aliyun.com/solution/tech-solution/nginx_ingress","isDisplayProductIcon":true,"productButton1":{"productButtonText":"方案详情","productButtonLink":"https://www.aliyun.com/solution/tech-solution/nginx_ingress"},"productButton2":{"productButtonText":"一键部署","productButtonLink":"https://help.aliyun.com/document_detail/2400022.html"},"productButton3":{"productButtonText":"查看更多技术解决方案","productButtonLink":"https://www.aliyun.com/solution/tech-solution/"},"productPromotionInfoBlock":[{"$id":"0","productPromotionGroupingTitle":"解决方案推荐","productPromotionInfoFirstText":"MSE实现全链路灰度","productPromotionInfoFirstLink":"https://www.aliyun.com/solution/tech-solution/iflgbomse","productPromotionInfoSecondText":"云上经典架构","productPromotionInfoSecondLink":"https://www.aliyun.com/solution/tech-solution/habwoc"}]},"activityCardInfo":{"activityTitle":"","activityDescription":"","cardContentBackgroundMode":"LightMode","activityContentBackgroundImageLink":"","activityCardBottomInfoSelect":"activityPromotionInfoBlock"}}
相关电子书
更多
《Nginx 代理系统常用手册》
CentOS Nginx PHP JAVA 多语言镜像使用手
CentOS Nginx PHP JAVA多语言镜像使用手册
立即下载 立即下载 立即下载

Nginx duplicate相关内容