Nginx服务器块不能正常工作? – 已经运行其他的虚拟主机,只是这一个不工作

我运行一个Debian 6 LEMP服务器与多个虚拟主机,一切都很好,5个左右的网站。 但我刚刚尝试添加另一个,但由于某种原因,它只是不工作。 我不工作,我的意思是在Chrome中,我得到了“糟糕!Google Chrome无法连接到subdomain.domain.net”错误。

我已将安全更改为subdomain.example.com ,并且IP被屏蔽。

主机文件(我有多个子域):

xxx.xxx.xx.xxx *.example.com *.example 

服务器块:

 server { listen 80; server_name subdomain.example.com; access_log /srv/www/subdomain.example.com/logs/access.log; error_log /srv/www/subdomain.example.com/logs/error.log; root /srv/www/subdomain.example.com/public_html; location / { index index.html index.htm index.php; } location ~ \.php$ { include fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } } 

我在/etc/nginx/sites-enabled/目录下创build了系统链接,并重新启动/重新加载了nginx。

DNS似乎很好:

 # ping -c 2 subdomain PING subdomain.example.com (xxx.xxx.xx.xxx) 56(84) bytes of data. 64 bytes from www.example.com (xxx.xxx.xx.xxx): icmp_req=1 ttl=64 time=0.035 ms 64 bytes from www.example.com (xxx.xxx.xx.xxx): icmp_req=2 ttl=64 time=0.048 ms 

使用cURL工作检查文件:

 # curl http://subdomain.example.com HTML - OK 

清空浏览器caching,但仍然没有骰子。

任何我失踪? 就像我提到的,我有几个网站在服务器上运行良好,所以php-fpm等等工作。 任何帮助将非常感激!

干杯,

戴夫

它很难帮助你,因为你没有提供足够的信息,但我会尝试

  • 主机文件不支持屏蔽,所以你不能使用“*”。 在您的主机文件。
  • 那个ping你是从哪里来的? 服务器或客户端?
  • curl使用-v来检查你的主机/ IP
  • 你的Chrome是否启用了某种代理? 这将有可能路线你不同于你的期望..

为我设置域名的人将其指向了错误的服务器IP,因此是问题所在。

小学生的错误,很抱歉打扰你们!

在附注中,hosts文件中的* .domain.com引用确实可以工作。