Puma not working with nginx in ROR

I use this command manually

bundle exec puma -e production -b unix:///var/www/rails_apps/agarcents/shared/tmp/sockets/puma.sock

      

My server is working fine. I can access the url, but when I bind the socket to nginx, I cannot access the server.

My nginx config

upstream puma_agarscents { 
  server unix:/var/www/rails_apps/agarcents/shared/tmp/sockets/puma.sock fail_timeout=0;
}

server {
  listen 80;
  server_name x.x.x.x; # change to match your URL
  root /var/www/rails_apps/agarcents/current/public;

  listen 443 ssl;

  location / {
    proxy_pass http://puma_agarscents;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }

  ssl_certificate /etc/nginx/ssl/nginx.crt;
  ssl_certificate_key /etc/nginx/ssl/nginx.key;

  location ~* ^/assets/ {
    # Per RFC2616 - 1 year maximum expiry
    expires 1y;
    add_header Cache-Control public;

    # Some browsers still send conditional-GET requests if there a
    # Last-Modified header or an ETag header even if they haven't
    # reached the expiry date sent in the Expires header.
    add_header Last-Modified "";
    add_header ETag "";
    break;
  }
}

      

Getting error below

2015/05/14 05:34:31 [error] 6802 # 0: * 79 connect () to unix: /var/www/rails_apps/agarcents/shared/tmp/sockets/puma.sock failed (11: Resource temporarily not available) when connected to an upstream, client: xxxx, server: xxxx, request: "GET /favicon.ico HTTP / 1.1", upstream: " http: // unix: / var / www / rails_apps / agarcents / shared /tmp/sockets/puma.sock:/favicon.ico ", host:" xxxx "

+3


source to share





All Articles