From a82c4b066a9e62215dc7a43447f43d3c1009ef45 Mon Sep 17 00:00:00 2001
From: Etienne Loupias <eloupias@grandlyon.com>
Date: Thu, 20 Mar 2025 16:03:40 +0100
Subject: [PATCH] fix

---
 Dockerfile       | 2 ++
 nginx/nginx.conf | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index 606e4e72a..c70010694 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -27,7 +27,9 @@ RUN npm run build:prod
 # Stage 1, based on Nginx, to have only the compiled app
 FROM ${DEPENDENCY_PROXY}nginxinc/nginx-unprivileged:1.25
 
+# Copy custom conf to write logs into file to persist them
 COPY nginx/nginx.conf /etc/nginx/nginx.conf
+RUN mkdir -p /var/log/nginx/persist
 
 # Copy nginx modified conf with template (cf. "Using environment variables in nginx configuration" in https://hub.docker.com/_/nginx )
 COPY nginx/templates/default.conf.template /etc/nginx/templates/default.conf.template
diff --git a/nginx/nginx.conf b/nginx/nginx.conf
index 1b97c5442..7c6dadaf7 100644
--- a/nginx/nginx.conf
+++ b/nginx/nginx.conf
@@ -26,7 +26,7 @@ http {
     # Default log which is redirected to stdout
     access_log  /var/log/nginx/access.log  main;
     # Also write to file to persist logs
-    access_log  /var/log/nginx/persist/access.$time_local.log  main;
+    access_log  /var/log/nginx/persist/access.$year-$month-$day.log  main;
 
     sendfile        on;
     #tcp_nopush     on;
-- 
GitLab