Recall & Review
beginner
What is the purpose of the
access_log directive in nginx?The
access_log directive in nginx is used to specify the file where nginx will record details about each client request, such as IP address, request time, and response status.Click to reveal answer
beginner
How do you disable access logging in an nginx server block?
You can disable access logging by setting
access_log off; inside the server or location block.Click to reveal answer
intermediate
What is the default format used by nginx for access logs?
The default format is called
combined, which includes client IP, timestamp, request line, status code, bytes sent, referrer, and user agent.Click to reveal answer
intermediate
How can you create a custom log format in nginx?
Use the
log_format directive to define a custom format with variables, then reference it in the access_log directive.Click to reveal answer
beginner
Where is the access log file typically located in a default nginx installation?
It is usually located at
/var/log/nginx/access.log.Click to reveal answer
Which directive in nginx controls where access logs are saved?
✗ Incorrect
The
access_log directive sets the file path for access logs.How do you turn off access logging in nginx?
✗ Incorrect
Setting
access_log off; disables access logging.What does the default nginx access log format include?
✗ Incorrect
The default
combined format includes all these details.Which directive allows defining a custom log format in nginx?
✗ Incorrect
The
log_format directive defines custom log formats.Where is the default nginx access log file usually stored?
✗ Incorrect
The default location is
/var/log/nginx/access.log.Explain how to configure a custom access log format in nginx and apply it.
Think about defining format first, then using it.
You got /3 concepts.
Describe how to disable access logging for a specific server block in nginx.
Focus on the access_log directive.
You got /2 concepts.