Unicorn + Nginx Rails production error -
i'm following this tutorial deploy ror app capistrano i'm getting error in production server
[error] 28314#0: *1 connect() unix:/tmp/unicorn.myapp.sock failed (111: connection refused) while connecting upstream, client: xx.xxx.xx.xx, server: , request: "get / http/1.1", upstream: "http://unix:/tmp/unicorn.myapp.sock:/", host: "myapp.cloudapp.azure.com"
my /etc/nginx/sites-available/default
upstream app { # path unicorn sock file, defined server unix:/tmp/unicorn.myapp.sock fail_timeout=0; } server { listen 3000; server_name localhost; root /home/deploy/apps/myapp/current/; try_files $uri/index.html $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; } error_page 500 502 503 504 /500.html; client_max_body_size 4g; keepalive_timeout 10; }
i changed server
many different things, exact same error, same host, server, upstream.
the problem unicorn, somewhere in capistrano deploy, wasn't restarting unicorn should.
nginx logs indicate issue backend server. after backend up , running. check:
- does socket file exist?
ls -lthd /tmp/unicorn.myapp.sock
- can make direct http connect socket, bypassing nginx?
once tests pass, test again through nginx.
Comments
Post a Comment