VPS侦探论坛

 找回密码
 注册
查看: 1638|回复: 3

nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed

[复制链接]
发表于 2022-6-28 13:42:42 | 显示全部楼层 |阅读模式

nginx: [emerg] duplicate location "/" in /usr/local/nginx/conf/vhost/www.xxx.com.conf:36
nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed


注释了两行

     #   location / {
            return 301 https://$host$request_uri;
     #   }

好了,会有啥问题么?

美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2022-6-28 13:44:05 | 显示全部楼层


1.9,我选了
Using 301 to Redirect HTTP to HTTPS? (y/n) y
可能是这个原因?
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2022-6-29 16:09:42 | 显示全部楼层

/usr/local/nginx/conf/rewrite/wordpress.conf里的
location / {
        try_files $uri $uri/ /index.php?$args;
}
和 vhost/www.xxxa.com.conf的
   location / {
            return 301 https://$host$request_uri;
        }
冲突了,咋办好?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2022-6-29 21:25:30 | 显示全部楼层



phpbird 发表于 2022-6-29 16:09
/usr/local/nginx/conf/rewrite/wordpress.conf里的
location / {
        try_files $uri $uri/ /index.ph ...

注释或删掉伪静态那一行就可以了
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-20 13:50 , Processed in 0.025978 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表