Created
July 22, 2021 15:41
-
-
Save pauiglesias/020d095f29d0a19db3f95ee8aa05a286 to your computer and use it in GitHub Desktop.
Set nginx log format with the current host called and total request time
This file contains 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 | |
log_format main '$remote_addr - $remote_user [$time_local] $request ' | |
'"$status" $body_bytes_sent "$http_referer" ' | |
'"$http_user_agent" "$http_x_forwarded_for"'; | |
log_format main2 '$remote_addr - $remote_user [$time_local] $request ' | |
'"$status" $body_bytes_sent "$http_referer" ' | |
'"$http_user_agent" "$http_x_forwarded_for" ' | |
'"$host" $request_time'; | |
log_format bytes '$body_bytes_sent'; | |
access_log /var/log/nginx/access.log main2; | |
access_log on; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment