fix(nginx): ensure /var/log/nginx and logs exist; set error_log to /var/log/nginx/error.log

Create /var/log/nginx and touch access.log/error.log in run.sh so nginx -t succeeds before reloads.
Revert nginx.conf error_log to /var/log/nginx/error.log (notice).
This commit is contained in:
Nawaz Dhandala
2025-11-06 11:34:19 +00:00
parent bb48776e02
commit fbe198f0c0
2 changed files with 5 additions and 1 deletions

View File

@@ -3,7 +3,7 @@ load_module modules/ngx_http_js_module.so;
user nginx;
worker_processes auto;
error_log stderr notice;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;

View File

@@ -17,6 +17,10 @@ else
export PROVISION_SSL=""
fi
# Ensure nginx log destinations exist so nginx -t succeeds even before reloads.
mkdir -p /var/log/nginx
touch /var/log/nginx/access.log /var/log/nginx/error.log
# Run envsubst on template
/etc/nginx/envsubst-on-templates.sh