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 disable access logging in nginx.
access_log [1];Setting access_log off; disables access logging in nginx.
Fix the error in the access log format definition.
log_format main '[1]';
The correct log format uses variables with $ and includes quotes and brackets exactly as shown in option C.
Fill both blanks to configure nginx to use the custom log format and specify the log file.
access_log [1] [2];
The access_log directive takes the log file path first, then the log format name.
Fill all three blanks to create a conditional access log that logs only requests with status code 404.
map $status $log_404 {
default 0;
[1] 1;
}
access_log [2] [3] if=$log_404;The map block sets $log_404 to 1 only when status is 404. The access_log directive uses this variable in the if condition to log only those requests.