-
Notifications
You must be signed in to change notification settings - Fork 1
/
default_addon.conf
35 lines (32 loc) · 1.61 KB
/
default_addon.conf
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
js_import logging.js;
js_set $request_headers_njs logging.request_headers;
js_set $response_headers_njs logging.response_headers;
js_set $request_body_njs logging.request_body;
js_set $response_body_njs logging.response_body;
log_format json escape=none '{"source": "nginx",'
'"msec": $msec,'
'"time_iso8601": "$time_iso8601",'
'"request_time": $request_time,'
'"body_bytes_sent": $body_bytes_sent,'
'"bytes_sent": $bytes_sent,'
'"request_length": $request_length,'
'"http_host": "$http_host",'
'"http_user_agent": "$http_user_agent",'
'"remote_addr": "$remote_addr",'
'"request_method": "$request_method",'
'"request_uri": "$request_uri",'
'"status": $status,'
'"upstream_addr": "$upstream_addr",'
'"request_body_njs": $request_body_njs,'
'"response_body_njs": $response_body_njs,'
'"request_headers_njs": $request_headers_njs,'
'"response_headers_njs": $response_headers_njs}';
server {
listen 80;
access_log /var/log/nginx/access.log json;
client_body_in_file_only clean;
location / {
js_body_filter logging.response_filter buffer_type=buffer;
proxy_pass http://127.0.0.1:8080;
}
}