Skip to content

Instantly share code, notes, and snippets.

@rodde177
Created August 21, 2019 11:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rodde177/eeffdd3322ad9ed46033e33c9d100a39 to your computer and use it in GitHub Desktop.
Save rodde177/eeffdd3322ad9ed46033e33c9d100a39 to your computer and use it in GitHub Desktop.
NGINX logging
log_format main '$http_x_forwarded_for - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent "$http_referer" '
'"$http_user_agent"' ;
log_format json_combined escape=json
'{'
'"time_local":"$time_local",'
'"remote_addr":"$http_x_forwarded_for",'
'"remote_user":"$remote_user",'
'"request":"$request",'
'"status": "$status",'
'"host": "$http_host",'
'"body_bytes_sent":"$body_bytes_sent",'
'"request_time":"$request_time",'
'"http_referrer":"$http_referer",'
'"http_user_agent":"$http_user_agent"'
'}';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment