User to start Passenger (with Nginx)
Solution 1
Put the following into your nginx.conf in the http block:
passenger_default_user custom_username;
passenger_default_group custom_group;
You can find more configuration options here:
http://modrails.com/documentation/Users%20guide%20Nginx.html#PassengerDefaultUser
Solution 2
At one point the user and group were determined by the owners of the config.ru file. I'm pretty sure this is still the case.
ceth
I'm a programmer, occasional SRE, Unix automator. I'm currently working primarily in Go, and prior to that my weapon of choice was Python, but I'm also familiar with Java, C#, JavaScript, and bash. I dabble in Clojure and F# but I've never thrown a big problem at it. I run Linux at home and at work but that doesn't mean I'm ignorant of other systems :)
Updated on August 06, 2022Comments
-
ceth over 1 year
I have Nginx with Passenger. In nginx.conf I have line:
user pass users;
and Nginx process works on 'pass' user, but Passenger* processes work on 'nobody' user.
I can run Passenger standalone:
sudo passanger start -e production -p 80 --user=pass
How can I run Passenger with Nginx with my custom user?
-
ceth almost 13 yearsIf I understood correctly your answer - I have user line in my nginx.conf (see my question). And Nginx stats for this user, but passenger doesn't.
-
ceth almost 13 yearsI post the question regarding Nginx and Passenger on ServerFault, but didn't get any answer. :(
-
ceth almost 13 yearsHere is the question serverfault.com/questions/276228/…. It is different, but I think that the problem is user rights.
-
Devin M almost 13 yearshmm, well does my answer fix the problem for you?
-
ceth almost 13 yearsNo, doesn't. I have user line in my nginx.conf (see my question). And Nginx stats for this user, but passenger doesn't.
-
Devin M almost 13 yearswhy cant you chown the files?
-
sqreept over 10 yearsSaved my day :). Why is that?
-
eltiare over 10 yearsI think it's to enable writing in the Rails directory if your scripts need it. It's fairly safe to assume that if the config.ru file has certain permissions the rest will have them, too.
-
rodvlopes over 3 yearswhen the owner is root, it will run as nobody