diff --git a/Dockerfile b/Dockerfile index c6467e5de2d568cddb4352797d14e7aca9414d1f..606e4e72ac9caee0e5f60ad6cb86bf6c4f4adb82 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 44dc4baa69257685f736446ebcbd32a70954fcca..2068ff231625eed41f9fa608a0873487ecbac95c 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