Update 'NGINX-Installer.sh'

This commit is contained in:
tbergervoet
2018-10-17 15:13:59 +02:00
parent 062650fb1f
commit 99c74069df

View File

@@ -3,7 +3,7 @@
###============================================================ ###============================================================
## Zet comments hieronder: ## Zet comments hieronder:
# #
# Add ssl_dhparam #
# #
##============================================================= ##=============================================================
@@ -30,7 +30,7 @@ mysql -u root -p"$password" -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH my
mysql -u root -p"$password" -e "FLUSH PRIVILEGES;" mysql -u root -p"$password" -e "FLUSH PRIVILEGES;"
mysql -u root -p"$password" -e "SELECT user,authentication_string,plugin,host FROM mysql.user;" mysql -u root -p"$password" -e "SELECT user,authentication_string,plugin,host FROM mysql.user;"
cat <<EOF > /etc/nginx/sites-available/"$domain" cat <<EOF > /etc/nginx/sites-available/"$domain"
fastcgi_cache_path /etc/nginx/cache levels=1:2 keys_zone=MYAPP:100m max_size=10g inactive=1440m; #fastcgi_cache_path /etc/nginx/cache levels=1:2 keys_zone=MYAPP:100m max_size=10g inactive=1440m;
upstream netdata { upstream netdata {
server 127.0.0.1:19999; server 127.0.0.1:19999;
@@ -46,6 +46,8 @@ server {
#return 301 \$scheme:/\$domain\$request_uri; Redirect to non-www #return 301 \$scheme:/\$domain\$request_uri; Redirect to non-www
#return 301 https://domein.nl$request_uri; Redirect to other domain #return 301 https://domein.nl$request_uri; Redirect to other domain
#add_header X-Cache "\$upstream_cache_status";
#netdata here #netdata here
gzip on; gzip on;
@@ -72,19 +74,19 @@ server {
location ~ \.php\$ { location ~ \.php\$ {
include snippets/fastcgi-php.conf; include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock; fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_cache MYAPP; #fastcgi_cache MYAPP;
fastcgi_cache_valid 200 302 301 1m; #fastcgi_cache_valid 200 302 301 1m;
fastcgi_cache_valid 404 1m; #fastcgi_cache_valid 404 1m;
fastcgi_cache_bypass \$no_cache; #fastcgi_cache_bypass \$no_cache;
fastcgi_no_cache \$no_cache; #fastcgi_no_cache \$no_cache;
fastcgi_cache_revalidate on; #fastcgi_cache_revalidate on;
fastcgi_cache_background_update on; #fastcgi_cache_background_update on;
fastcgi_cache_lock on; #fastcgi_cache_lock on;
fastcgi_cache_use_stale updating; #fastcgi_cache_use_stale updating;
fastcgi_buffer_size 128k; #fastcgi_buffer_size 128k;
fastcgi_buffers 256 16k; #fastcgi_buffers 256 16k;
fastcgi_busy_buffers_size 256k; #fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k; #fastcgi_temp_file_write_size 256k;
} }
location ~ /\.ht { location ~ /\.ht {
@@ -131,8 +133,7 @@ events {
http { http {
fastcgi_cache_key \$scheme\$request_method\$host\$request_uri; #fastcgi_cache_key \$scheme\$request_method\$host\$request_uri;
add_header X-Cache "\$upstream_cache_status";
sendfile on; sendfile on;
tcp_nopush on; tcp_nopush on;
@@ -255,9 +256,7 @@ if [ $redis = 1 ]; then
sed -i 's/# bind 127.0.0.1 ::1/bind 127.0.0.1 ::1/g' /etc/redis/redis.conf sed -i 's/# bind 127.0.0.1 ::1/bind 127.0.0.1 ::1/g' /etc/redis/redis.conf
sed -i 's/# requirepass foobared/requirepass '$password'/g' /etc/redis/redis.conf sed -i 's/# requirepass foobared/requirepass '$password'/g' /etc/redis/redis.conf
# systemctl stop redis # systemctl stop redis
# systemctl stop redis.service
# systemctl disable redis # systemctl disable redis
# systemctl disable redis.service
fi fi
##-------------## ##-------------##