Log format
vim/usr/local/nginx/conf/nginx.conf//Search Log_format
$remote _addr |
Client IP (public IP) |
$http _x_forwarded_for |
IP of the proxy server |
$time _local |
Server local time |
$host |
Access host name (domain name) |
$request _uri |
URL address of the access |
$status |
Status code |
$http _referer |
Referer |
$http _user_agent |
User_agent |
The master configuration file is configured with an access log in the format named Combined_realip log_format combined_realip ' $remote _addr $http _x_forwarded_for [$time _local] ' ' $host ' $request _uri "$status" "$http _referer" "$http _user_agent"; In addition to defining the log format in the Master Profile nginx.conf, you also need to add the server block in the virtual host configuration file, followed by Combined_realip for the log format name, configured in the master configuration file Access_log/tmp/1.log Combined_realip; The combined_realip here is the name of the log format defined in nginx.conf-t &&-S reload curl-x127.0.0.1:80 test.com-i Cat/tmp/1.log
Linux10.6 nginx Access Log