So I have a Ruby on Rails app in /var/www/ owned by nginx with 755 permissions. Said app is intended to be deployed via puma.
Like so:
rvmsudo -u nginx bundle exec puma -e production -d -b unix:///var/www/my_app/tmp/sockets/my_app.socket The permissions for the socket are:
srwxrwxrwx. 1 nginx nginx 0 Nov 6 09:43 tmp/sockets/my_app.sock The process is, of course, owned by nginx:
nginx 7335 0.0 8.8 536744 90388 ? Sl 09:43 0:00 puma 2.9.2 (unix:///var/www/my_app/tmp/sockets/my_app.sock) My nginx configuration configuration is as follows:
upstream my_app { server unix:///var/www/my_app/tmp/sockets/my_app.sock; } server { listen 80; server_name www.example.com example.com; root /var/www/my_app/public; location / { proxy_pass http://my_app; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } All of this and my application is still denied permissions.
connect() to unix:///var/www/my_app/tmp/sockets/my_app.sock failed (13: Permission denied) while connecting to upstream, I have tried all of this as the root user, also. But it still does not work.
Does anyone know what I am doing wrong?