Nginx继续展示欢迎来到Nginx

时间:2012-12-21 17:11:19

标签: nginx centos

我正在使用Cent OS 6.1。 我从源代码安装了./configure方法的Nginx。我通过sudo nginx启动了nginx服务器,它可以提供Welcome to Nginx页面。

但是,当我编辑/usr/local/nginx/conf/nginx.conf文件时,我发现更改...location / {... }...块没有任何效果。

例如,更改

location / {
    root html;
    index index.htm index.html;
}

location / {
    root xyz123; #which does not exist
    index index.htm index.html;
}

应该给404.但它一直显示欢迎页面。

即使我删除了整个位置块,它仍会显示欢迎页面。但是,如果我将/usr/local/nginx/html更改为/usr/local/nginx/htmlxyz,则会显示404.是否有另一个正在运行的conf文件覆盖了nginx.conf?

P.S。我做了sudo nginx -s stop然后sudo nginxsudo nginx -s reopen但没有帮助:(

1 个答案:

答案 0 :(得分:0)

为什么要安装EPEL。我已经安装了10个nginx服务器,它正在使用Node.js。

也许你可以得到一些错误?显示完整./configure。

Centos的Nginx / Php / Mysql示例:

https://www.howtoforge.com/installing-nginx-with-php5-and-php-fpm-and-mysql-support-on-centos-6.4

默认centos nginx html路径: 的/ usr /共享/ nginx的/ HTML /