不能设置nginx,但我的configuration文件似乎没问题

我有一个服务器在176.227.213.2 。 所以我创build了一个默认服务器的configuration文件( default.conf

server { listen 80; server_name default 176.227.213.2; location / { root /var/www/html; index index.php index.html; } ......... 

完整的configuration 。 但是我无法获得一个index.html的工作。 服务器没有响应。 访问日志是空的,我认为这意味着,nginx根本就不听请求。 我检查了path和文件。

我不知道这里有什么问题。

更新

netstat -plutn

 Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 590/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 855/sendmail: accep tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 1991/php-fpm: maste tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 756/mysqld tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 3031/nginx: master tcp 0 0 0.0.0.0:10000 0.0.0.0:* LISTEN 759/perl tcp6 0 0 :::22 :::* LISTEN 590/sshd udp 0 0 0.0.0.0:10000 0.0.0.0:* 759/perl 

更新2 :在@jamzed的build议后,我检查了我的iptables,并意识到端口80未打开。 添加了一个打开端口的规则,重新启动我的系统,它像一个魅力。 希望能帮助到你!

尝试从本地连接到本地主机:

$ printf“GET / HTTP / 1.0 \ r \ n \ r \ n”| nc 127.0.0.1 80

要么

$ telnet 127.0.0.1 80

你检查了端口80的防火墙规则吗? 你也可以使用tcpdump并检查数据包是否进入你的web服务器。

问题也许fastcgi_pass 127.0.0.1:9000; 。 尝试将其更改为fastcgi_pass 176.227.213.2:9000;

检查你的防火墙规则,它可以阻止stream量到127.0.0.1