Skip to content

Commit

Permalink
proxy: config to log slow requests for napi proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
baabeetaa committed Oct 14, 2023
1 parent 00fda31 commit 33a44b4
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions notionalapi/proxy/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,19 @@ http {
include mime.types;
default_type application/octet-stream;

#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';

#access_log logs/access.log main;
access_log off;
# config to log slow requests only
log_format main escape=none '$request_time "$time_local" $remote_addr "$http_user_agent" $host" $request_uri $request_body';
map $request_uri $loggable_request
{
~*\/websocket 0;
default 1;
}
map $request_time $loggable
{
~^[0-9]\. 0;
default $loggable_request;
}
access_log /var/log/nginx/access.log main if=$loggable;

sendfile on;
#tcp_nopush on;
Expand Down

0 comments on commit 33a44b4

Please sign in to comment.