diff --git a/nginx/nginx.conf b/nginx/nginx.conf
index 9b85d572ab7322bfc2f5b45d1937d28f89c93ef0..229a30885508f07be521372bc74e1c720cb8f2f6 100644
--- a/nginx/nginx.conf
+++ b/nginx/nginx.conf
@@ -8,18 +8,6 @@ events {
     worker_connections  1024;
 }
 
-map $time_iso8601 $year {
-    default '0000';
-    "~^(\d{4})-(\d{2})-(\d{2})" $1;
-}
-map $time_iso8601 $month {
-    default '00';
-    "~^(\d{4})-(\d{2})-(\d{2})" $2;
-}
-map $time_iso8601 $day {
-    default '00';
-    "~^(\d{4})-(\d{2})-(\d{2})" $3;
-}
 
 http {
     proxy_temp_path /tmp/proxy_temp;
@@ -35,6 +23,19 @@ http {
                       '$status $body_bytes_sent "$http_referer" '
                       '"$http_user_agent" "$http_x_forwarded_for"';
 
+    map $time_iso8601 $year {
+        default '0000';
+        "~^(\d{4})-(\d{2})-(\d{2})" $1;
+    }
+    map $time_iso8601 $month {
+        default '00';
+        "~^(\d{4})-(\d{2})-(\d{2})" $2;
+    }
+    map $time_iso8601 $day {
+        default '00';
+        "~^(\d{4})-(\d{2})-(\d{2})" $3;
+    }
+
     # Default log which is redirected to stdout
     access_log  /var/log/nginx/access.log  main;
     # Also write to file to persist logs