File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,15 @@ sed -i "s|__BACKEND_BASE_URL__|${BACKEND}|g" /etc/nginx/conf.d/api-proxy.conf
115115
116116echo " ✅ Wrote /etc/nginx/conf.d/api-proxy.conf (proxy -> ${BACKEND} /api/)"
117117
118+ # Remove any default server-level configuration that may exist in /etc/nginx/conf.d
119+ # (for example the base image's default.conf). Our custom nginx.conf expects the
120+ # conf.d fragments to contain only `location` blocks; a top-level `server { ... }`
121+ # in conf.d will cause nginx to error with: "'server' directive is not allowed here".
122+ if [ -f /etc/nginx/conf.d/default.conf ]; then
123+ echo " ⚠️ Removing /etc/nginx/conf.d/default.conf to avoid nested server blocks"
124+ rm -f /etc/nginx/conf.d/default.conf || true
125+ fi
126+
118127# Start nginx
119128echo " 🌐 Starting nginx..."
120129exec nginx -g " daemon off;"
You can’t perform that action at this time.
0 commit comments