Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nginx trying to open passengerfile.json which doen't exist

I am trying to deploy my rails app(API only) using capistrano to the centos server with Nginx and passenger. When I try to hit the rails application, it says Error opening '/home/user/app/current/Passengerfile.json' for reading: Permission denied (errno=13); This error means that the Nginx worker process (PID 4344, running as UID 984) does not have permission to access this file.

But I don't have passengerfile.json in there and we don't need it.

like image 740
Bishal Shrestha Avatar asked Oct 31 '25 11:10

Bishal Shrestha


2 Answers

Try adding the below line to your nginx.conf file.

user deploy

Replace deploy by your deploy user name

FYI: I followed these steps to install passenger (Installing passenger from ruby gems(rvm))

like image 119
Prasath Rajasekaran Avatar answered Nov 03 '25 10:11

Prasath Rajasekaran


It seems that error was occurring because I was trying to deploy my app through root user. Once I created deploy user and deployed it by that user and added:

passenger_user_switching on;
passenger_user deploy;
passenger_group deploy;

to the passenger.conf it worked perfectly.

like image 40
Bishal Shrestha Avatar answered Nov 03 '25 10:11

Bishal Shrestha