Troubleshooting Techniques
[ 196 ]
If the new binary still has a master process running, you can send it a TERM signal to
force it to quit:
kill -TERM cat /var/run/nginx.pid
Likewise, any new worker processes that are still running may first be stopped with
a KILL signal.
Note that some operating systems will automatically perform the binary
upgrade procedure for you when the nginx package is upgraded.
Once we have our debug-enabled nginx binary running, we can configure
debug logging:
user www;
events {
worker_connections 1024;
}
error_log logs/debug.log debug;
http {
...
}
We have placed the error_log directive in the main context of the NGINX
configuration, so that it will be valid for each subcontext, if not overwritten
within. We can have multiple error_log directives, each pointing to a different
file and with a different logging level. In addition to debug, error_log can also
take on the following values:
- debug_core
- debug_alloc
- debug_mutex
- debug_event
- debug_http
- debug_imap