首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >nginx修改index参数不生效问题一解

nginx修改index参数不生效问题一解

原创
作者头像
信和网站维护中心
发布2022-07-13 16:32:49
2.5K0
发布2022-07-13 16:32:49
举报

修改nginx的index文件后,重启nginx,未生效。

后来排查发现,每次重启nginx,都会提示

 正在启动 nginx:nginx: [warn] conflicting server name "index" on 0.0.0.0:80, ignored
 nginx: [warn] conflicting server name "index.html" on 0.0.0.0:80, ignored
 nginx: [warn] conflicting server name "index.htm" on 0.0.0.0:80, ignored
 nginx: [warn] conflicting server name "index.php" on 0.0.0.0:80, ignored
 nginx: [warn] conflicting server name "index" on 0.0.0.0:80, ignored
 nginx: [warn] conflicting server name "index.html" on 0.0.0.0:80, ignored
 nginx: [warn] conflicting server name "index.htm" on 0.0.0.0:80, ignored
 nginx: [warn] conflicting server name "index.php" on 0.0.0.0:80, ignored

前几次没留意,后来发现修改的inde的顺序没生效。回头来排查发现原来同一个配置文件中,其他站点的server_name后面没有添加结束字符(;)导致了index参数被作为了server_name的一部分导致的。

挨个核实了下全部配置文件的站点参数,竟然有两个站点都是这样的问题。

添加后,重启nginx,测试index的设置生效。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档