我将 nginx 用于 uniq 应用程序,然后按照本教程显示的步骤进行了更改并配置了服务器 block (AKA Vhost-in apache)
(see the tutorial)
在我重新启动 VPS 之前,服务器一直正常工作(只需服务 gninx 重新启动)
现在 NGINX 没有启动并且没有显示输出消息
(尝试了所有的开始方式)
我错过了什么?$ /etc/init.d/nginx status
返回:
* nginx is not running
从我的本地机器挖掘返回
$ 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和域名都是假的-.-'
最佳答案
你这里好像有问题:
#server {
listen 80 default;
server_name anything;
# Everything is a 404
location / {
return 404;
}
}
server
被注释掉,但该集中的其他行没有。如果您打算注释掉整个
server
block ,您需要使用:#server {
# listen 80 default;
# server_name anything;
# # Everything is a 404
# location / {
# return 404;
# }
#}
关于ruby-on-rails - Nginx 不再启动并且不提供输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16929193/