unicorn error with nginx/rails4 - no child processes

Trying to setup a DigitalOcean VPS droplet (Ubuntu 12.10 rails4/ruby2.0.0p353/nginx/unicorn) with one app. I think unicorn is my current barrier–nginx seems to be running, waiting to forward responses to unicorn on :8080, but there’s some stock setup I’m not understanding. Do I need to tweak the unicorn run or somehow get unicorn_rails working? My basic capistrano deploy works, at least enough to get the files to the server. My goal here is at least getting the site running to the point of postgres errors i.e. the db doesn’t yet exist, and that’s another challenge.

  • DigitalOcean sets up an app at /home/rails out of the box, which runs fine.
  • I updated /etc/nginx/sites-enabled/default (below) to my app’s properties and restarted
  • I added config/unicorn.rb to my site and try to restart unicorn/unicorn_rails/etc, still can’t get it right /etc/nginx/sites-enabled/default (my changes)

upstream unicorn {

server unix:/tmp/.sock fail_timeout=0;


server {

listen 80;

root /var/www/myapp/current/public;

server_name mysite.com;

index index.htm index.html;

location / {

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


location ~* ^.+.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|ex

e>pdf>ppt>txt>tar>mid>midi>wav>bmp>rtf>js>mp3|flv|mpeg|avi)$ {

location ~* ^.+.(jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|tx

t>tar>mid>midi>wav>bmp>rtf>mp3|flv|mpeg|avi)$ {

try_files $uri @app;


location @app {

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_set_header Host $http_host;

proxy_redirect off;

proxy_pass http://app_server;



myapp/config/unicorn.rb (my attempt)

working_directory “/var/www/myapp/current”

listen “/tmp/.sock”, :backlog => 64

listen 8080, :tcp_nopush => true

worker_processes 2 # this should be >= nr_cpus

timeout 30

pid “/var/www/myapp/shared/pids/unicorn.pid”

stderr_path “/var/www/myapp/shared/log/unicorn.log”

stdout_path “/var/www/myapp/shared/log/unicorn.log”

/home/unicorn/unicorn.rb (DO’s out of the box config)

listen “”

worker_processes 2

user “rails”

working_directory “/home/rails”

pid “/home/unicorn/pids/unicorn.pid”

stderr_path “/home/unicorn/log/unicorn.log”

stdout_path “/home/unicorn/log/unicorn.log”

tail unicorn.log (the boldface error log below is what I think happens when I make a request to the site and I get the public/500.html)