Linux10.6 nginx Access Log

Source: Internet
Author: User
Tags local time

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.