Can't start unicorn, master failed to start, check stderr log for details

不问归期 提交于 2019-12-04 01:11:59

The socket is the "file" that nginx and unicorn use as a channel for all communication between them. Where have you defined it? In our unicorn configs, we usually have a line like this:

listen APP_PATH + "/tmp/pid/.unicorn.sock

Then, in your nginx.conf, you need to tell nginx about this socket, e.g.:

upstream unicorn {
  server unix:/var/www/demo/tmp/pid/.unicorn.sock fail_timeout=0;
}

location / {
  root /var/www/demo/current/public ;
  try_files $uri @unicorns;
}

location @unicorns {
  proxy_pass http://unicorn;
}

In this config file, the first section defines how nginx can reach unicorn. The second one actually routes requests to an abstract location "@unicorns" which, in turn, is defined in the last section. This way you can reuse the @unicorns shorthand if your have more complex nginx routing going on.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!