私は Passenger から Unicorn への移行の過程にあり、構成を機能させるのに少し苦労しています。
私が見ている問題は、すべての接続がタイムアウトしているように見えるが、stderr.log および stdout.log ファイルにエラーが記録されていないことです。ポートが AWS sec グループで開いていることを確認しました。
これは私がstderr.logに見ているものです
I, [2012-08-21T19:26:36.462776 #7989]  INFO -- : unlinking existing socket=/data/test/staging/current/tmp/sockets/unicorn.sock
I, [2012-08-21T19:26:36.463048 #7989]  INFO -- : listening on addr=/data/test/staging/current/tmp/sockets/unicorn.sock fd=3
I, [2012-08-21T19:26:36.463466 #7989]  INFO -- : Refreshing Gem list
I, [2012-08-21T19:27:50.293399 #7989]  INFO -- : master process ready
I, [2012-08-21T19:27:50.687491 #8083]  INFO -- : worker=0 ready
I, [2012-08-21T19:27:50.751790 #8086]  INFO -- : worker=1 ready
cache: [GET /] miss
これが私の現在の構成構造です。
nginx.conf
user www-data;
worker_processes  2;
daemon off;
error_log  /var/log/nginx/error.log;
pid        /var/run/nginx.pid;
events {
  worker_connections  1024;
}
http {
  include       /etc/nginx/mime.types;
  default_type  application/octet-stream;
  access_log    /var/log/nginx/access.log;
  sendfile on;
  tcp_nopush on;
  tcp_nodelay on;
  keepalive_timeout  65;
  gzip  on;
  gzip_http_version 1.0;
  gzip_comp_level 2;
  gzip_proxied any;
  gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript application/json;
  server_names_hash_bucket_size 64;
  include /etc/nginx/conf.d/*.conf;
  include /etc/nginx/sites-enabled/*;
}
unicorn.rb
worker_processes 2
working_directory "/data/test/staging/current"
preload_app true
timeout 30
listen "/data/test/staging/current/tmp/sockets/unicorn.sock", :backlog => 64
pid "/data/test/staging/current/tmp/pids/unicorn.pid"
# Set the path of the log files inside the log folder of the testapp
stderr_path "/data/test/staging/current/log/unicorn.stderr.log"
stdout_path "/data/test/staging/current/log/unicorn.stdout.log"
before_fork do |server, worker|
  defined?(ActiveRecord::Base) and
    ActiveRecord::Base.connection.disconnect!
end
after_fork do |server, worker|
  defined?(ActiveRecord::Base) and
    ActiveRecord::Base.establish_connection
end
000-デフォルト
upstream test_server {
 #This is the socket we configured in unicorn.rb
 server unix:/data/test/staging/current/tmp/sockets/unicorn.sock »
 fail_timeout=0;
}
server {
listen 80;
client_max_body_size 4G;
server_name http://ec2-23-22-53-139.compute-1.amazonaws.com;
keepalive_timeout 5;
# Location of our static files
root /data/test/staging/current/public;
location / {
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header Host $http_host;
  proxy_redirect off;
  # If you don't find the filename in the static files
  # Then request it from the unicorn server
  if (!-f $request_filename) {
    proxy_pass http://test_server;
    break;
  }
}
error_page 500 502 503 504 /500.html;
location = /500.html {
  root /data/test/staging/current/public;
}
}