From f2e8b790ce62023cda191b0beeb0752df3f16d26 Mon Sep 17 00:00:00 2001
From: Etienne Loupias <eloupias@grandlyon.com>
Date: Thu, 20 Mar 2025 15:39:44 +0100
Subject: [PATCH] get nginx.conf default from official nginx-unprivileged:1.25
 image

---
 Dockerfile       |  2 ++
 nginx/nginx.conf | 23 ++++++++++++++++-------
 2 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index c6467e5de..606e4e72a 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -27,6 +27,8 @@ 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 nginx/nginx.conf /etc/nginx/nginx.conf
+
 # 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 44dc4baa6..2068ff231 100644
--- a/nginx/nginx.conf
+++ b/nginx/nginx.conf
@@ -1,12 +1,21 @@
-worker_processes  1;
-error_log  /var/log/nginx/error.log warn;
-pid        /var/run/nginx.pid;
+worker_processes  auto;
+
+error_log  /var/log/nginx/error.log notice;
+pid        /tmp/nginx.pid;
+
 
 events {
     worker_connections  1024;
 }
 
+
 http {
+    proxy_temp_path /tmp/proxy_temp;
+    client_body_temp_path /tmp/client_temp;
+    fastcgi_temp_path /tmp/fastcgi_temp;
+    uwsgi_temp_path /tmp/uwsgi_temp;
+    scgi_temp_path /tmp/scgi_temp;
+
     include       /etc/nginx/mime.types;
     default_type  application/octet-stream;
 
@@ -15,20 +24,20 @@ http {
                       '"$http_user_agent" "$http_x_forwarded_for"'
                       '"$upstream_uri"';
 
-    # Default log to stdout
+    # 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;
 
     sendfile        on;
+    #tcp_nopush     on;
 
     keepalive_timeout  65;
 
-    gzip  on;
+    #gzip  on;
 
     include /etc/nginx/conf.d/*.conf;
 
     # Max Body Size
     client_max_body_size 10M;
-
-}
+}
\ No newline at end of file
-- 
GitLab