diff --git a/.env.prod b/.env.prod index 9ed4a2762759d7736e1ce0de6bc4a418cc50a5a7..024b6f172596dcd93b8de999b86c9651ba9de0b4 100644 --- a/.env.prod +++ b/.env.prod @@ -13,3 +13,4 @@ CI_REGISTRY_IMAGE=image SENTRY_DSN=public_key:gitlab.com SENTRY_TRACES_SAMPLE_RATE=1.0 ENVIRONMENT_NAME=prod +LOG_DIRECTORY=/volumes/spot-nginx-log/ diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 21028f8d31ce89e296902b55f0064a6bcb658d1a..e2f9f614a011fea000d3c5e5d1d93f66b37df0be 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -40,9 +40,7 @@ services: ENVIRONMENT_NAME: "${ENVIRONMENT_NAME}" spot-nginx: - image: nginx:1.21 - # container_name: spot-nginx - logging: *default-logging + image: nginx:1.23 restart: always networks: - ${INTERNAL_NETWORK_NAME} @@ -51,6 +49,7 @@ services: - ./etc/nginx/nginx.conf:/etc/nginx/nginx.conf - ./etc/nginx/proxy_spot_params:/etc/nginx/proxy_spot_params - ./searx/static:/var/www/spot/static + - ${LOG_DIRECTORY}:/var/log/nginx filtron: image: dalf/filtron:latest diff --git a/etc/nginx/nginx.conf b/etc/nginx/nginx.conf index 235b9309d7a253b00a30421c44be554c95ddc7b2..d0e73015aef1b9dd1656c382d43c878b56d35f3f 100644 --- a/etc/nginx/nginx.conf +++ b/etc/nginx/nginx.conf @@ -2,7 +2,6 @@ user nginx; worker_processes auto; -error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; @@ -18,8 +17,9 @@ http { log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$remote_addr"'; - - access_log /var/log/nginx/access.log main; + + access_log /var/log/nginx/access.log main; + error_log /var/log/nginx/error.log warn; sendfile on; #tcp_nopush on;