nginx log format field

1 Log management

1.1 nginx log description

Through the access log, you can get the relevant information such as the user's geographical source, jump source, terminal used, and the amount of access to a URL; through the error log, you can get the performance bottleneck of a service or server in the system. The log is the information, and the log is the problem. s answer.


1.2 The log format of nginx, open the nginx.conf file

image.png

Parameter details:

$remote_addr client ip address (proxy server, display proxy service ip)

$http_x_forwarded_for can record the client IP and record the client's IP address through the proxy server

$remote_user User records the user name of the remote client (usually '-')

$time_local utility records access time and time zone

$status response status code '404' page not found '200' success etc.

$request_time The total time of the entire request, from receiving the first byte of the user request to sending the response data, that is, including the time to receive the request data, the program response time, and the time to output the response data

$bytes_sent the number of bytes transmitted to the client

$body_bytes_sent The number of bytes of the file subject content sent to the client, the response header is not included

$request_length The length of the request (including the requested address, http request headers and request body)

$http_referer url jump source, used to record from which page link is accessed

$upstream_addr The address of the background service (that is, the target address of the forwarding process)

$upstream_response_time The time from when nginx establishes a connection to the backend to when it accepts data and closes the connection

$http_user_agent The proxy used by the user (usually the browser)

$request is used to record the requested url and request method

$request_body The client's request body, this variable can be used in location to pass the request body to the next-level proxy through proxy_pass, fastcgi_pass, uwsgi_pass and scgi_pass

$args parameter values ​​in the request

$uri The current URI in the request (without request parameters, the parameters are located in $args), which can be different from the value of $request_uri passed by the browser, which can be modified by internal redirection, or by using the index directive

$request_uri This variable is equal to the original URI containing some client request parameters, it cannot be modified

$request is used to record the requested url and request method

$remote_port client port










Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325304240&siteId=291194637