nginx -s reload, 提示 [emerg] duplicate location “/“

问题描述:

执行nginx -s reload, 提示 `duplicate location /`

问题原因:

是因为location / 有两个,匹配重复了

解决方案:

把其中一个location / 注释掉,即可

相关推荐
北城笑笑2 小时前
Server 18 ,Nginx + Vite 前端部署排错实战:从 `/api/gpt/chat` 404 到 9012 后端服务的完整定位过程
linux·运维·前端·nginx·ubuntu·vue
fatcoder21 小时前
玩转Nginx 04 — 反向代理:给 nginx 接上后端
前端·后端·nginx
fatcoder1 天前
玩转Nginx 03 — location 匹配规则:让不同的路径各回各家
前端·后端·nginx
王坊兴1 天前
Ubuntu 部署产品原型静态服务器:SFTP + Nginx
服务器·nginx·ubuntu
烬羽1 天前
nginx 里写 localhost 反而 502?一条请求带你彻底搞懂 Docker 端口映射与反向代理
nginx·docker·程序员
小林ixn1 天前
Docker + Nginx 反向代理:从“我电脑能跑”到“哪里都能跑”
nginx·docker·容器
CDN3601 天前
源站隐藏实操:出海网站 IP 暴露、被扫描打源,CDN+Nginx 白名单加固方案
网络·tcp/ip·nginx·源站隐藏·cdn防护
运维全栈笔记1 天前
Ubuntu 24.04 Certbot 自动化SSL证书配置指南
linux·运维·服务器·nginx·ubuntu·自动化·ssl
ly76891 天前
负载均衡详解:从四层、七层到 LVS、Keepalived、Nginx 与 HAProxy
nginx·负载均衡·lvs
用户938515635072 天前
Docker + Nginx + Node.js:从“我的电脑能跑,你的电脑跑不了”到一键部署
后端·nginx·docker