我正在使用nginx作为uniq应用程序,然后我更改了它并配置了服务器块(AKA Vhost-in apache),按照此tuto显示的步骤 (see the tutorial)
服务器工作(仅使用 service gninx restart ),直到我重新启动VPS
现在NGINX启动并且没有输出MSG正在显示 (尝试了所有的开始方式)
我错过了什么?
$ /etc/init.d/nginx status
返回
* nginx is not running
我本地计算机上的Diggin返回
$ dig http://www.xx.com
; <<>> DiG 9.8.1-P1 <<>> http://www.xx.com
;; global options: +cmd
;; connection timed out; no servers could be reached
(在编辑时添加) - - - - - - - - - - - 对于我的其他域名
; <<>> DiG 9.8.1-P1 <<>> http://www.xx.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 5145
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;http://www.xx.com IN A
;; AUTHORITY SECTION:
xx.com . 900 IN SOA
;; Query time: 39 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Tue Jun 4 21:01:55 2013
;; MSG SIZE rcvd: 110
当curl:
curl http://www.xx.com -v
* About to connect() to www.xx.com port 80 (#0)
* Trying 198.199.199.155... Conexão recusada*
* couldn't connect to host
* Closing connection #0
curl: (7) couldn't connect to host
* (拒绝连接)
ping结果:
33 packets transmitted, 33 received, 0% packet loss, time 197754ms
我的配置:
我已将我的域名添加到 / etc / hosts
127.0.0.1 localhost xx
198.199.199.155 www.xx.com
198.199.199.155 xx.com
198.199.199.155 www.yy.com
198.199.199.155 yy.com
在我的 /etc/nginx/nginx.conf
上worker_processes 1;
user nobody nogroup;
pid /tmp/nginx.pid;
error_log /tmp/nginx.error.log;
events {
worker_connections 1024;
accept_mutex off;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /tmp/nginx.access.log combined;
sendfile on;
tcp_nopush on;
tcp_nodelay off;
gzip on;
gzip_http_version 1.0;
gzip_proxied any;
gzip_min_length 500;
gzip_disable "MSIE [1-6]\.";
gzip_types text/plain text/xml text/css
text/comma-separated-values
text/javascript application/x-javascript
application/atom+xml;
include /etc/nginx/sites-enabled/*;
##########################################################
# Catch all requests to server ip so just hitting the ip
# won't render anything.
##########################################################
server {
listen 80 default;
server_name anything;
# Everything is a 404
location / {
return 404;
}
}
}
- 已编辑 -
ps:IP和域名都是假货 - .-'
答案 0 :(得分:2)
您似乎遇到了问题:
#server {
listen 80 default;
server_name anything;
# Everything is a 404
location / {
return 404;
}
}
server
已被注释掉,但该组中的其他行不是。
如果您打算评论整个server
块,则需要使用:
#server {
# listen 80 default;
# server_name anything;
# # Everything is a 404
# location / {
# return 404;
# }
#}