From d7b018cd91c246fd574b7087d51f18f0854bbd44 Mon Sep 17 00:00:00 2001 From: tbergervoet Date: Mon, 15 Oct 2018 14:01:56 +0200 Subject: [PATCH] Update 'NGINX-Installer.sh' --- NGINX-Installer.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/NGINX-Installer.sh b/NGINX-Installer.sh index 026888d..cb37f9b 100644 --- a/NGINX-Installer.sh +++ b/NGINX-Installer.sh @@ -32,8 +32,6 @@ mysql -u root -p"$password" -e "SELECT user,authentication_string,plugin,host FR cat < /etc/nginx/sites-available/"$domain" fastcgi_cache_path /etc/nginx/cache levels=1:2 keys_zone=MYAPP:100m max_size=10g inactive=1440m; -#netdata placeholder - server { listen 80; listen [::]:80; @@ -122,6 +120,11 @@ worker_processes auto; pid /run/nginx.pid; include /etc/nginx/modules-enabled/*.conf; +upstream netdata { + server 127.0.0.1:19999; + keepalive 64; +} + events { worker_connections 1024; } @@ -227,7 +230,6 @@ if [ $netdata = 1 ]; then apt install -y netdata sed -i 's/SEND_EMAIL="YES"/SEND_EMAIL="NO"/g' /etc/netdata/health_alarm_notify.conf ufw allow 19999/tcp - sed -i 's+#netdata placeholder+upstream netdata {\n server 127.0.0.1:19999;\n keepalive 64;\n}+g' /etc/nginx/sites-available/"$domain" sed -i 's+#netdata here+location = /netdata {\n return 301 /netdata/;\n }\n\n location ~ /netdata/(?.*) {\n proxy_redirect off;\n proxy_set_header Host \$host;\n proxy_set_header X-Forwarded-Host \$host;\n proxy_set_header X-Forwarded-Server \$host;\n proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;\n proxy_http_version 1.1;\n proxy_pass_request_headers on;\n proxy_set_header Connection "keep-alive";\n proxy_store off;\n proxy_pass http://netdata/\$ndpath\$is_args\$args;\n }+g' /etc/nginx/sites-available/"$domain" # systemctl stop netdata # systemctl disable netdata