Complete the code to enable debug logging in nginx configuration.
error_log /var/log/nginx/error.log [1];Setting the error_log level to debug enables detailed debug logging in nginx.
Complete the code to enable debug mode for a specific nginx location block.
location /test {
[1] on;
}The debug_connection directive enables debug logging for connections from specific IPs or all if set to 'all'.
Fix the error in the nginx debug log directive to correctly enable debug logging.
error_log /var/log/nginx/debug.log [1] debug;The off keyword disables the default log level, allowing the explicit debug level to work correctly.
Fill both blanks to configure nginx to log debug messages only for connections from localhost.
error_log /var/log/nginx/error.log [1]; debug_connection [2];
Set error_log level to debug and debug_connection to 127.0.0.1 to enable debug logs only for localhost connections.
Fill all three blanks to create a map that enables debug logging only for requests from a specific IP.
map $remote_addr $debug_mode {
default [1];
[2] [3];
}This map sets debug_mode to off by default, but turns it on for the IP 192.168.1.100.