On the surface, it is to decide whether Nginx is running in the foreground (daemon off;) or running in the background (daemon on;);
What we generate from the command line is the initialization process , which will generate the main process and the worker process , but after that, it exits.
Therefore, although there are Nginx processes in the system, they are not the original startup processes, they are all derived.
Therefore, we must enable the -g "daemon on;" configuration in the systemd Supervisor Dockerfile.
references
- WikiNotes/daemon off;
- What is the difference between nginx daemon on/off option?
- How to run Nginx within a Docker container without halting?
- Controlling Nginx with Supervisor