nginx不尊重“root”指令

我正在用Ubuntu运行一个EC2实例,并试图为两个域名安装虚拟服务器,但没有运气,也找不到原因。 我的web文档位于/var/www/<domain>www文件夹下的所有内容都属于www-data:www-data (目前只有两个index.htmls)。 我已经将站点configuration文件放在/etc/nginx/sites-available ,并将它们链接到sites-enabledsites-enabled 。 网站configuration文件和符号链接也属于www-data:www-data以防万一。 我还将我的域名与服务器的公共IP地址添加到/etc/hosts ,当然在EC2控制台中启用了端口80。

这里是/etc/nginx/nginx.conf

 user www-data www-data; worker_processes 4; pid /var/run/nginx.pid; events { worker_connections 16; } http { sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log debug; gzip on; gzip_disable "msie6"; include /etc/nginx/sites-enabled/*; } 

而其中一个网站的configuration(另一个不同的域名):

 server { listen 80; server_name domain1.com www.domain1.com; root /var/www/domain1; index index.html; access_log /var/log/nginx/access_domain1.log; error_log /var/log/nginx/error_domain1.log; } 

每次configuration更改后,服务器当然都会重新启动。 添加一个location指令,如:

 location / { index index.html; root /var/www/domain1; } 

也没有帮助。 添加try_files (例如$uri $uri/ )也无济于事。 在nginx.conf中定义一个默认的服务器,如:

 server { listen 80 default_server; server_name localhost; root /var/www; index index.html; } 

也不会帮助。

服务器是nginx 1.1.19。

尽pipeconfiguration我只得到“欢迎使用nginx!” 而不是位于/var/www中的index.html文件。