From 9c6b313435877bffd8e8ad672b2fad20419ec8c3 Mon Sep 17 00:00:00 2001 From: denshooter Date: Mon, 15 Sep 2025 23:48:46 +0200 Subject: [PATCH] Fix nginx configuration conflict in docker-compose - Remove default nginx configuration files to prevent conflicts - Add command to clear /etc/nginx/conf.d/* before starting nginx - This fixes the 'events directive not allowed here' error --- docker-compose.zero-downtime-fixed.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker-compose.zero-downtime-fixed.yml b/docker-compose.zero-downtime-fixed.yml index 0e623aa..fac30d5 100644 --- a/docker-compose.zero-downtime-fixed.yml +++ b/docker-compose.zero-downtime-fixed.yml @@ -13,6 +13,8 @@ services: volumes: # Use a more robust path that works in CI/CD environments - ./nginx-zero-downtime.conf:/etc/nginx/nginx.conf:ro + # Remove default nginx configuration to prevent conflicts + - /etc/nginx/conf.d networks: - portfolio_net depends_on: @@ -26,6 +28,9 @@ services: # Fallback: if the config file doesn't exist, create a basic one command: > sh -c " + # Remove default nginx configuration files to prevent conflicts + rm -rf /etc/nginx/conf.d/* + if [ ! -f /etc/nginx/nginx.conf ]; then echo 'Creating fallback nginx configuration...' cat > /etc/nginx/nginx.conf << 'EOF'