Skip to content

Parse Nginx log Example

luopengift edited this page Sep 14, 2017 · 4 revisions
/etc/nginx/nginx.conf
http {
    server_names_hash_bucket_size 128;
    proxy_headers_hash_bucket_size 128;
    proxy_headers_hash_max_size 1024;
    client_max_body_size 8m;   #HTTP请求的BODY最大限制值,若超出此值,报413 Request Entity Too Large
   
    open_log_file_cache off; 
    log_format main '$time_iso8601|$http_x_forwarded_for|$remote_addr|$upstream_addr|$server_addr|$hostname|$http_host|$server_name|$http_referer|$status|$body_bytes_sent|$upstream_response_time|$request_time|$request_method|$https|$scheme|$request_uri|$http_user_agent|$args|$request_body';

    access_log  /data/logs/nginx/access.log main;
    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

    ....

}
Clone this wiki locally