First, Introduction
The format of the log file in Nginx is defined in nginx.conf, and its default format is as follows:
#vim/usr/local/nginx/conf/nginx.conf
Log_format access ' $remote _addr– $remote _user [$time _local] "$request" ' $status $body _bytes_sent ' $http _referer ' "$ Http_user_agent "$http _x_forwarded_for";
Where the meaning of each field is as follows:
1. $remote _addr and $http_x_forwarded_for used to record the IP address of the client;
2. $remote _user: Used to record the client user name;
3. $time _local: Used to record access time and time zone;
4. $request: The URL used to record the request and the HTTP protocol;
5. $status: Used to record request status; Success is 200.
6. $body _bytes_s ent: Records sent to the client file body content size;
7. $http _referer: Used to record links from the page to visit;
8. $http _user_agent: Record the relevant information of the client browser;
References: http://www.linuxidc.com/Linux/2012-12/75658.htm