nginx 502 Bad Gateway after rails deploy -
i deploying rails app nginx , unicorn , getting 502 bad getway.
can me solve this? thank much
my nginx error log (/var/log/nginx/error.log) shows:
2015/05/14 00:26:22 [crit] 24642#0: *13 connect() unix:/tmp/unicorn.easysign.sock failed (2: no such file or directory) while connecting upstream, client: 89.100.32.54, server: localhost, request: "get /easysign http/1.1", upstream: "http://unix:/tmp/unicorn.easysign.sock:/500.html", host: "mysite.com"
/etc/nginx/conf.d/default.conf:
upstream app { # path unicorn sock file, defined server unix:/tmp/unicorn.easysign.sock fail_timeout=0; } server { listen 80; server_name localhost; root /var/www/mysite.com/public_html/easysign; try_files $uri/index.html $uri @app; location @app { proxy_pass http://app; proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; proxy_set_header host $http_host; proxy_redirect off; } error_page 500 502 503 504 /500.html; client_max_body_size 4g; keepalive_timeout 10; }
/var/www/[app name]/config/unicorn.rb:
root = "/var/www/mysite.com/public_html/" working_directory root pid "#{root}/tmp/pids/unicorn.pid" stderr_path "#{root}/log/unicorn.log" stdout_path "#{root}/log/unicorn.log" listen "/tmp/unicorn.easysign.sock" worker_processes 1 timeout 30
please try change path socket (for example) "/var/www/sockets/unicorn.easysign.sock". don't forget create "/var/www/sockets" directory. maybe there issue privileges?
Comments
Post a Comment