Skip to content

Instantly share code, notes, and snippets.

@gnilchee gnilchee/nginx.conf
Created Sep 9, 2018

Embed
What would you like to do?
example nginx.conf with json logging (nginx 1.11.8+)
log_format json_combined escape=json
'{'
'"time_local":"$time_local", '
'"remote_addr":"$remote_addr", '
'"client_addr":"$proxy_add_x_forwarded_for", '
'"request_type": "$request_method", '
'"request":"$request", '
'"request_uri": "$uri", '
'"query_string": "$query_string", '
'"status": "$status", '
'"geoip_city": "$geoip_city", '
'"geoip_lat": "$geoip_latitude", '
'"geoip_long": "$geoip_longitude", '
'"body_bytes_sent":"$body_bytes_sent", '
'"total_bytes_sent": "$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
You can’t perform that action at this time.