Update 'NGINX-Installer.sh'
This commit is contained in:
@@ -206,27 +206,7 @@ server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
|
||||
location = /netdata {
|
||||
return 301 /netdata/;
|
||||
}
|
||||
|
||||
location ~ /netdata/(?<ndpath>.*) {
|
||||
proxy_redirect off;
|
||||
proxy_set_header Host \$host;
|
||||
|
||||
proxy_set_header X-Forwarded-Host \$host;
|
||||
proxy_set_header X-Forwarded-Server \$host;
|
||||
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
|
||||
proxy_http_version 1.1;
|
||||
proxy_pass_request_headers on;
|
||||
proxy_set_header Connection "keep-alive";
|
||||
proxy_store off;
|
||||
proxy_pass http://netdata/\$ndpath\$is_args\$args;
|
||||
|
||||
gzip on;
|
||||
gzip_proxied any;
|
||||
gzip_types *;
|
||||
}
|
||||
#netdata here
|
||||
|
||||
root /var/www/html;
|
||||
index index.php index.html index.htm index.nginx-debian.html;
|
||||
@@ -265,6 +245,9 @@ sed -i 's/;opcache.max_accelerated_files=10000/opcache.max_accelerated_files=500
|
||||
sed -i 's/;opcache.max_wasted_percentage=5/opcache.max_wasted_percentage=5/g' /etc/php/7.2/fpm/php.ini
|
||||
sed -i 's/;opcache.revalidate_freq=2/opcache.revalidate_freq=0/g' /etc/php/7.2/fpm/php.ini
|
||||
sed -i 's/; max_input_vars = 1000/max_input_vars = 10000/g' /etc/php/7.2/fpm/php.ini
|
||||
sed -i 's/; max_input_vars = 1000/max_input_vars = 10000/g' /etc/php/7.2/fpm/php.ini
|
||||
sed -i 's/upload_max_filesize = 2/upload_max_filesize = 128/g' /etc/php/7.2/fpm/php.ini
|
||||
sed -i 's/post_max_size = 8/post_max_size = 64/g' /etc/php/7.2/fpm/php.ini
|
||||
|
||||
##----------------##
|
||||
# PHPMyAdmin #
|
||||
@@ -276,9 +259,8 @@ debconf-set-selections <<< "phpmyadmin phpmyadmin/mysql/admin-pass password $pas
|
||||
debconf-set-selections <<< "phpmyadmin phpmyadmin/mysql/app-pass password $passsword"
|
||||
debconf-set-selections <<< "phpmyadmin phpmyadmin/reconfigure-webserver multiselect"
|
||||
apt install -y phpmyadmin
|
||||
ln -s /usr/share/phpmyadmin /var/www/"$domain"/html
|
||||
# Redirect phpmyadmin -> database
|
||||
mv /var/www/"$domain"/html/phpmyadmin /var/www/"$domain"/html/database
|
||||
ln -s /usr/share/phpmyadmin /var/www/"$domain"/html/database
|
||||
|
||||
##-------------##
|
||||
# Postfix #
|
||||
@@ -306,6 +288,7 @@ if [ $netdata = 1 ]
|
||||
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 here+location = /netdata {\n return 301 /netdata/;\n }\n\n location ~ /netdata/(?<ndpath\>.*) {\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 gzip on\n gzip_proxied any;\n gzip_types *;\n }+g' /etc/nginx/sites-available/"$domain"
|
||||
# systemctl stop netdata
|
||||
# systemctl disable netdata
|
||||
fi
|
||||
@@ -341,13 +324,11 @@ fi
|
||||
# Certbot #
|
||||
##-------------##
|
||||
|
||||
#add-apt-repository -y ppa:certbot/certbot
|
||||
apt install -y python-certbot-nginx
|
||||
#certbot --nginx -d $domain -d www.$domain
|
||||
#sed -i 's/ssl ipv6only/ssl http2 ipv6only/g' /etc/nginx/sites-available/"$domain"
|
||||
#sed -i 's/listen 443 ssl/listen 443 ssl http2/g' /etc/nginx/sites-available/"$domain"
|
||||
#sed -i 's#include /etc/letsencrypt/options-ssl-nginx.conf;#ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;#g' /etc/nginx/sites-available/"$domain"
|
||||
#check certbot auto-renewal -> certbot renew --dry-run
|
||||
certbot --nginx -n -d "$domain" -d "www.$domain" -m "$email" --hsts --redirect --no-eff-email --agree-tos
|
||||
sed -i 's/ssl ipv6only/ssl http2 ipv6only/g' /etc/nginx/sites-available/"$domain"
|
||||
sed -i 's/listen 443 ssl/listen 443 ssl http2/g' /etc/nginx/sites-available/"$domain"
|
||||
sed -i 's#include /etc/letsencrypt/options-ssl-nginx.conf;#ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;#g' /etc/nginx/sites-available/"$domain"
|
||||
|
||||
##---------------##
|
||||
# Wordpress #
|
||||
|
||||
Reference in New Issue
Block a user