Nginx/puma rhel unix socket permission error?
- by Kevin Brown
When I try to start my puma server, I get the error:
/.rvm/gems/ruby-2.1.1/gems/puma-2.9.0/lib/puma/binder.rb:275:in `initialize': Permission denied - connect(2) for "/var/run/nvhbase.sock" (Errno::EACCES)
My sites-available/nvhbase.conf file:
upstream nvhbase {
server unix:/var/run/nvhbase.sock;
}
server {
listen 80 default_server;
server_name 207.131.132.219;
root /home/vf032500/dev/nvh/public;
location / {
proxy_pass http://unix:/var/run/nvhbase.sock;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect off;
}
}
I don't know a lot about unix sockets and everything works fine using tcp/puma default. My rails app is in my user directory. Is that the problem?? socket is starting in /var/run--I can start in /tmp, but I've heard that's bad practice?
Provided I start the server in /tmp, I then can't access it via the server's ip--then what?
I'm happy to provide any needed info, I just don't know a whole lot about server/nginx/puma.