Proper User Directive

Bee.Lists bee.lists at gmail.com
Thu Aug 23 00:32:01 UTC 2018


Hi there.  My question is about using a proper user.  

This directive was initially blank, then Passenger (nginx on FreeBSD) threw an error:

env: bash: No such file or directory
uid=65534(nobody) gid=65534(nobody) groups=65534(nobody)

PWD=/usr/local/www/pneb
HOME=/nonexistent
SHELL=/usr/sbin/nologin
LOGNAME=nobody
USER=nobody
PASSENGER_APP_ENV=production
NODE_ENV=production
WSGI_ENV=production
RACK_ENV=production
RAILS_ENV=production
NODE_PATH=/usr/local/lib/ruby/gems/2.4/gems/passenger-5.3.4/src/nodejs_supportlib
PYTHONUNBUFFERED=1
PASSENGER_SPAWN_WORK_DIR=/tmp/passenger.spawn.8FRO7ztegy
IN_PASSENGER=1
SERVER_SOFTWARE=nginx/1.14.0 Phusion_Passenger/5.3.4
PASSENGER_USE_FEEDBACK_FD=true
PATH=/sbin:/bin:/usr/sbin:/usr/bin
RC_PID=35522

So the lack of a user closed up the $PATH to bash for some reason.  I tried www and my own username, resulting in the same errors.  

The example on nginx.com states "www www” as the user, but that gives me the same error.

I checked the documentation and it is not even two lines long:

http://nginx.org/en/docs/ngx_core_module.html#user

So I’m without a user and/or group to run nginx.  Is there something I’m missing?  Everywhere I look, people are confused about the user/group to run nginx as.  “root” doesn’t work, and I’ve been told not to run it as root.  

How can I get this to work?  

Cheers, Bee






More information about the nginx mailing list