diff --git a/NGINX-Installer.sh b/NGINX-Installer.sh index c155abd..9ff255b 100644 --- a/NGINX-Installer.sh +++ b/NGINX-Installer.sh @@ -37,12 +37,18 @@ upstream netdata { keepalive 64; } +server { + listen 80; + server_name www.$domain; + return 301 http://$domain/\$request_uri\; +} + server { listen 80; listen [::]:80; root /var/www/$domain/html; index index.php index.html index.htm index.nginx-debian.html; - server_name $domain www.$domain; + server_name $domain; #return 301 \$scheme:/\$domain\$request_uri; Redirect to non-www #return 301 https://domein.nl$request_uri; Redirect to other domain @@ -52,7 +58,7 @@ server { gzip on; gzip_proxied any; - gzip_types text/plain text/css text/xml text/javascript application/javascript application/x-javascript image/svg+xml application/xml image/x-icon; + gzip_types text/plain text/css text/xml text/javascript application/javascript application/x-javascript image/svg image/svg+xml application/xml image/x-icon; gzip_min_length 1000; gzip_comp_level 2; gzip_disable "msie6"; @@ -67,9 +73,10 @@ server { location = /favicon.ico { log_not_found off; access_log off; } location = /robots.txt { log_not_found off; access_log off; allow all; } - location ~* \.(css|gif|ico|jpeg|jpg|js|png|svg|eot|otf|woff|woff2|ttf|ogg)\$ { + location ~* \.(css|gif|ico|jpeg|jpg|js|png|svg|webp|eot|otf|woff|woff2|ttf|ogg)\$ { expires max; log_not_found off; + add_header Cache-Control "public, no-transform"; } location ~ \.php\$ {