Created
September 9, 2018 04:19
-
-
Save gnilchee/242f93bebb21d69f21c79b1cebb01b6f to your computer and use it in GitHub Desktop.
example nginx.conf with json logging (nginx 1.11.8+)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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