返回首页

Supervisor monitors the problem that nginx keeps restarting

Supervisor monitors the problem that nginx keeps restarting

Scroll down here to see more content

supervisor monitors the problem that nginx keeps restarting

Supervisor monitors nginx. After writing the configuration file, it is found that it keeps restarting. After troubleshooting, it is found that the command is wrong:

command = /usr/local/bin/nginx This command starts in the background by default, but the supervisor cannot monitor the background program, so the supervisor always executes this command.

Adding the -g ‘daemon off;’ parameter can solve this problem. This parameter means running in the foreground.

command = /usr/local/bin/nginx -g ‘daemon off;’

The complete supervisor monitoring nginx configuration is as follows:

[program:nginx]
 
command = /usr/local/bin/nginx  -g 'daemon off;'
 
stdout_logfile=/Users/ddios/nginx_stdout.log
 
stdout_logfile_maxbytes=10MB
 
stderr_logfile=/Users/ddios/nginx_stderr.log
 
user = ddios
 
stderr_logfile_maxbytes=10MB
 
autostart=true
 
autorestart=true
FAQ

读完之后,下一步看什么

如果还想继续了解,可以从下面几个方向接着读。