• Problem: A user reported an error this morning saying that 403Forbbien was inaccessible. We just made a change last night. Nginx on the nginx machine was started as user appuser before, but was started as user root during last night’s change.
  • Nginx: nginx: nginx: nginx: nginx: nginx: nginx: nginx: nginx: nginx: nginx: nginx
  • Nginx has two types of processes, the master process and the worker process. The master process is the main process. There’s only one in the system. The main purpose of the main process is to read and evaluate configuration files, and to maintain worker processes. There can be multiple worker processes in the system. The worker process performs the actual processing of the request. NGINX relies on operating system-dependent mechanisms to efficiently distribute requests between worker processes. The number of worker processes is defined by the worker_processes directive in the nginx.conf configuration file and can be set to a fixed number or configured to automatically adjust to the number of available CPU cores.
  • Direct view now Nginx process in the system: ps – ef | grep Nginx.
  • See a master and a worker. Then the master has the root permission and the worker has the nobody permission. So you can see why you don’t have access.
  • There are two ways to solve the problem
  • One is to kill the process started by root and start the process again as user appuser. This is the way to solve the problem. The work process is no longer nobody but appuser

  • Second, you can change the user identity of worker processes in Nginx, because the default is nobody. /etc/nginx/nginx.conf file with a #user:nobody line in the header. The nginx documentation also states that the default is nobody. Uncomment nobody and change it to root.