Created
July 19, 2023 15:39
-
-
Save gvych/9765740e83d0bf56f283036f1e71ba9f to your computer and use it in GitHub Desktop.
NGINX logging json format (for containerization)
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",' | |
'"remote_user":"$remote_user",' | |
'"upstream_addr":"$upstream_addr",' | |
'"request":"$request",' | |
'"status": "$status",' | |
'"body_bytes_sent":"$body_bytes_sent",' | |
'"request_time":"$request_time",' | |
'"http_referrer":"$http_referer",' | |
'"http_user_agent":"$http_user_agent"' | |
'}'; | |
server { | |
listen 80; | |
server_name _; | |
access_log /dev/stdout json_combined; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment