unicorn 和 nginx 出错了

unicorn 和 nginx 出错了

我尝试通过 Capistrano 部署我的应用程序。已完成,但当我启动 Nginx 并在浏览器中显示我的网站时,我看到“我们很抱歉,但有些不对劲。

这很糟糕。我用的是 unicorn。查看我的配置https://gist.github.com/3904032 我尝试通过启动服务器rails s -e prodiction并且它成功了!

我认为这个错误可能是因为我无法重新启动服务器

root@li272-194:~# /etc/init.d/nginx restart
Restarting nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
configuration file /etc/nginx/nginx.conf test is successful
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: still could not bind()
nginx.

有任何想法吗?

nginx 日志

2012/10/17 02:57:41 [error] 3271#0: *1 could not find named location "@myapp", client: 91.192.62.77, server: 178.79.153.194, request: "GET / HTTP/1.1", host: "178.79.153.194"

2012/10/17 02:19:08 [crit] 2448#0: *8 connect() to unix:/srv/zarcon/shared/unicorn.sock failed (2: No such file or directory) while connecting to upstream, client: 91.192.62.77, server: zarkon, request:
"GET / HTTP/1.1", upstream: "http://unix:/srv/zarcon/shared/unicorn.sock:/", host: "178.79.153.194"

答案1

nginx 配置中的第 32 行指的是@myapp

try_files $uri/index.html $uri.html $uri @myapp;

您是指参考吗@zarkon

try_files $uri/index.html $uri.html $uri @zarkon;

并提交pid /tmp/nginx.pid;字符串

相关内容