Add / change the following to /etc/nginx/nginx.conf:
user nginx;
You must create user replicas and grant permissions for web court directories.
Thus, only the master process works like root. Because: Only root processes can listen on ports below 1024. The web server usually runs on port 80 and / or 443. This means that it must be run with root privileges.
To start the master process as a user without root:
Change ownership of the following:
- error_log
- access_log
- PID
- client_body_temp_path
- fastcgi_temp_path
- proxy_temp_path
- scgi_temp_path
- uwsgi_temp_path
Change the listening directives to ports above 1024, log in as a user and run nginx on nginx -c /path/to/nginx.conf
source
share