Created
August 14, 2020 13:51
-
-
Save 4ndrej/5934e3c2179a500e896b186e97685eaf to your computer and use it in GitHub Desktop.
nginx yyyy-mm logging without if
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
http { | |
#access_log logs/access.log main; | |
# parse \d{4}-\d{2} from $time_iso8601 into $yyyy_mm | |
map $time_iso8601 $yyyy_mm { | |
"~^(?<temp>\d{4}-\d{2})" $temp; | |
} | |
server { | |
listen 80; | |
server_name _; | |
location / { | |
access_log logs/access-80-$yyyy_mm.log; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment