1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
log_format main escape=json
'{'
'"ngx": {'
'"datetime": "$time_iso8601",'
'"server": {'
'"hostname": "$hostname",'
'"name": "$server_name",'
'"addr": "$server_addr",'
'"port": "$server_port",'
'"protocol": "$server_protocol"'
'},'
'"request": {'
'"method": "$request_method",'
'"scheme": "$scheme",'
'"host": "$host",'
'"request_uri": "$request_uri",'
'"uri": "$uri",'
'"args": "$args",'
'"remote_addr": "$remote_addr",'
'"remote_port": "$remote_port",'
'"length": "$request_length",'
'"time": "$request_time",'
'"content_length": "$content_length",'
'"content_type": "$content_type",'
'"user_agent": "$http_user_agent",'
'"referer": "$http_referer",'
'"x_real_ip": "$http_x_real_ip",'
'"x_forwarded_for": "$http_x_forwarded_for",'
'"x_forwarded_proto": "$http_x_forwarded_proto",'
'"x_scheme": "$http_x_scheme"'
'},'
'"response": {'
'"bytes_sent": "$bytes_sent",'
'"body_bytes_sent": "$body_bytes_sent",'
'"status": "$status"'
'},'
'"upstream": {'
'"addr": "$upstream_addr",'
'"connect_time": "$upstream_connect_time",'
'"header_time": "$upstream_header_time",'
'"response_time": "$upstream_response_time",'
'"cache_status": "$upstream_cache_status",'
'"status": "$upstream_status"'
'},'
'"limit": {'
'"conn_status": "$limit_conn_status",'
'"req_status": "$limit_req_status"'
'}'
'}'
'}';
access_log /var/log/nginx/default/access.log main;
error_log /var/log/nginx/default/error.log warn;
|