phpbird 发表于 2022-6-28 13:42:42

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

nginx: 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;
   #   }

好了,会有啥问题么?

phpbird 发表于 2022-6-28 13:44:05

1.9,我选了
Using 301 to Redirect HTTP to HTTPS? (y/n) y
可能是这个原因?

phpbird 发表于 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;
      }
冲突了,咋办好?

licess 发表于 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 ...

注释或删掉伪静态那一行就可以了
页: [1]
查看完整版本: nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed