Chapter 8
[ 197 ]
Each level is to debug a specific module within NGINX.
It also makes sense to configure a separate error log per virtual server. That way,
the errors related only to that server are found in a specific log. This concept can
be extended to include the core and http modules as well:
error_log logs/core_error.log;
events {
worker_connections 1024;
}
http {
error_log logs/http_error.log;
server {
server_name http://www.example.com;
error_log logs/www.example.com_error.log;
}
server {
server_name http://www.example.org;
error_log logs/www.example.org_error.log;
}
}
Using this pattern, we are able to debug a particular virtual host, if that is the area
we are interested in:
server {
server_name http://www.example.org;
error_log logs/www.example.org_debug.log debug_http;
}