Understanding access log columns in Nginx

Better Stack Team
Updated on October 11, 2023

The NGINX logs the activities of all the visitors to your site in the access logs. Here you can find which files are accessed, how NGINX responded to a request, what browser a client is using, IP address of clients and more. It is possible to use the information from the access log to analyze the traffic to find sites usages over time.

Default format

By default, the format of the access log columns is the following:

 
# nginx.conf
http {
  ...
  log_format combined '$remote_addr - $remote_user [$time_local] '
                      '"$request" $status $body_bytes_sent '
                      '"$http_referer" "$http_user_agent"';
  ...
}

As you can see the columns represent the following values in order:

  • $remote_addr - Address of the client
  • $remote_user [$time_local] - Information about user and local time of the client
  • $request - Request that has been sent by the client (GET,POST,PUT …)
  • $status - HTTP status code
  • $body_bytes_sent - The size of the body of the request in bytes
  • $http_referer - Address of the HTTP referer
  • $http_user_agent - User Agent of the client
Got an article suggestion? Let us know
Explore more
Licensed under CC-BY-NC-SA

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Make your mark

Join the writer's program

Are you a developer and love writing and sharing your knowledge with the world? Join our guest writing program and get paid for writing amazing technical guides. We'll get them to the right readers that will appreciate them.

Write for us
Writer of the month
Marin Bezhanov
Marin is a software engineer and architect with a broad range of experience working...
Build on top of Better Stack

Write a script, app or project on top of Better Stack and share it with the world. Make a public repository and share it with us at our email.

community@betterstack.com

or submit a pull request and help us build better products for everyone.

See the full list of amazing projects on github