在表面上,就是決定 Nginx 是前台運行(daemon off;)還是后台運行(daemon on;);
我們在命令行執行而產生的是初始化進程,它會產生主進程和工作進程,但是在這之后,他就退出了。
因此,雖然在系統中存在 Nginx 進程,但是它們都也不是原來的啟動進程,全是派生出來的。
因此我們在 systemd Supervisor Dockerfile 中,都要啟用 -g "daemon on;" 配置。
參考文獻
- 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