【发布时间】:2015-09-29 07:03:29
【问题描述】:
我正在尝试打开我的网页http://moneytree.space/catalogs/traders,但我得到了:
unicorn 和 nginx 正在运行。我的工作目录是/home/zhall/zoulfia
root@moneytree:/home/zhall/zoulfia# rails s -e production
=> Booting Unicorn
=> Rails 4.2.0 application starting in production on
http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
当我输入时:
在我的 /etc/nginx/sites-avalable/default 文件中,我得到了:
我需要将 server_name 更改为 localhost 吗?我是所有这些配置的新手,任何帮助将不胜感激。谢谢你。 也许我的服务器因为出现一些错误而关闭。我不知道在哪里追捕他们。我的日志文件是空的:(
我检查 nginx 配置:
sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
当我启动 webrick 时:
Zoulfias-iMac:zoulfia zoulfiahall$ rails s -e production
=> Booting WEBrick
=> Rails 4.2.0 application starting in production on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2015-07-10 17:08:38] INFO WEBrick 1.3.1
[2015-07-10 17:08:38] INFO ruby 2.2.0 (2014-12-25) [x86_64-darwin13]
[2015-07-10 17:08:38] INFO WEBrick::HTTPServer#start: pid=18631 port=3000
启动我的应用程序没有问题。
当 Unicorn 服务器启动时,我得到:
root@moneytree:/home/zhall/zoulfia# rails s -p80 -e production
=> Booting Unicorn
=> Rails 4.2.0 application starting in production on http://localhost:80
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
root@moneytree:/home/zhall/zoulfia# ------> this line should not be here!
如何设置应用程序日志记录以查看错误?
【问题讨论】:
-
我在你的
netstat结果中看不到nginx,如果我尝试telnet到你服务器上的端口80,我会得到Connection refused。 -
感谢您的回复。这是什么意思?我需要做什么来纠正它。可能导致这种情况发生的错误有哪些?
-
我认为你的 nginx 配置有问题。 See this question。您可能还想尝试在Server Fault 上发帖。
标签: nginx unicorn server-name