Complete the code to define a custom log format named 'main'.
log_format main '[1]';
This is the standard custom log format that includes client IP, user, time, request, status, and bytes sent.
Complete the code to set the access log to use the custom format 'main'.
access_log /var/log/nginx/access.log [1];The access_log directive uses the custom format name 'main' to log requests.
Fix the error in the log_format directive to correctly include the request time.
log_format timed '$remote_addr - $remote_user [$time_local] "$request" [1] $status';
The correct variable for request processing time is $request_time.
Fill both blanks to create a log format that logs client IP and user agent.
log_format client_info '[1] - "$http_user_agent" [2]';
The format logs the client IP ($remote_addr) and the remote user ($remote_user) along with the user agent.
Fill all three blanks to define a log format that logs the method, URI, and status code.
log_format method_uri_status '[1] [2] [3]';
This format logs the HTTP method, the requested URI, and the response status code.