ruby on rails - Nginx (111: Connection refused) while connecting to upstream -


i'm try run rails apps on production (vps).

i'm using rbenv, unicorn, nginx, os ubuntu server..

i have config unicorn , nginx :

file : config/unicorn.rb

app_dir = "/home/axx/apps/axx"  working_directory "/home/axx/apps/axx" pid "/home/axx/apps/axx/tmp/pids/unicorn.pid" stderr_path "/home/axx/apps/axx/unicorn/unicorn.log" stdout_path "/home/axx/apps/axx/unicorn/unicorn.log"  listen "/home/axx/apps/axx/tmp/sockets/unicorn.axx.sock" worker_processes 2 timeout 30 

file : /etc/nginx/sites-available/default

upstream app_server {   server unix:/home/axx/apps/axx/tmp/sockets/unicorn.axx.sock fail_timeout=0; }  server {   listen 80;   server_name localhost;    root home/axx/apps/axx/public;    location / {     proxy_set_header  x-real-ip  $remote_addr;     proxy_set_header  x-forwarded-for $proxy_add_x_forwarded_for;     proxy_set_header host $http_host;     proxy_redirect off;      if (-f $request_filename/index.html) {       rewrite (.*) $1/index.html break;     }      if (-f $request_filename.html) {       rewrite (.*) $1.html break;     }      if (!-f $request_filename) {       proxy_pass http://app_server;       break;     }   } } 

but when access site, 502 error. go check unicorn , nginx :

nginx/error.log

connect() unix:/home/axx/apps/axx/tmp/sockets/unicorn.axx.sock failed (111: connection refused) while connecting upstream, 

i try search questions in site , googling too, can't solve problem.

check /etc/nginx/nginx.conf file , path unicorn.sock file. in case missing current folder directory name.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -