From ad2904619d9d9e69badc023df1ecddf088363119 Mon Sep 17 00:00:00 2001 From: Joby Elliott Date: Wed, 23 Oct 2024 17:09:11 -0600 Subject: [PATCH] nginx config fix --- install/nginx-cloudflare-fail2ban.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install/nginx-cloudflare-fail2ban.sh b/install/nginx-cloudflare-fail2ban.sh index 9f65ba3..8cdba5d 100644 --- a/install/nginx-cloudflare-fail2ban.sh +++ b/install/nginx-cloudflare-fail2ban.sh @@ -8,19 +8,19 @@ fi # Install requirements echo "Installing required packages..." -apt-get install -y nginx-extras +apt-get install -y nginx-extras nginx-module-njs # Add load_module directive to nginx.conf if not present echo "Adding load_module directive to nginx.conf if needed..." if ! grep -q "^load_module.*ngx_http_js_module.so" /etc/nginx/nginx.conf; then # Create temporary file - sed '/^events {/i load_module modules/ngx_http_js_module.so;' /etc/nginx/nginx.conf > /tmp/nginx.conf.tmp + sed '/^events {/i load_module /usr/lib/nginx/modules/ngx_http_js_module.so;' /etc/nginx/nginx.conf > /tmp/nginx.conf.tmp # Check if the modification was successful if nginx -t -c /tmp/nginx.conf.tmp; then mv /tmp/nginx.conf.tmp /etc/nginx/nginx.conf else rm /tmp/nginx.conf.tmp - echo "Failed to modify nginx.conf safely. Please add 'load_module modules/ngx_http_js_module.so;' manually." + echo "Failed to modify nginx.conf safely. Please add 'load_module /usr/lib/nginx/modules/ngx_http_js_module.so;' manually." exit 1 fi fi