Complete the code to enable access logging in nginx.
access_log [1];The access_log directive specifies the file where nginx writes access logs. The default and common path is /var/log/nginx/access.log.
Complete the code to set the log format to 'combined' in nginx.
log_format main [1];The log_format directive defines a log format. The 'combined' format is a standard format that includes common fields for access logs.
Fix the error in the nginx configuration to log errors to the correct file.
error_log [1] warn;The error_log directive specifies where nginx writes error logs. The standard path is /var/log/nginx/error.log.
Fill both blanks to configure nginx to log access using the 'main' format to the correct file.
access_log [1] [2];
The access_log directive takes the log file path and the log format name. Here, the file is /var/log/nginx/access.log and the format is main.
Fill all three blanks to create a custom log format named 'detailed' that logs client IP, request method, and status code.
log_format detailed '[1] [2] [3]';
The custom log format uses variables: $remote_addr for client IP, $request_method for HTTP method, and $status for response status code.