Update 'Extra_Domains/NGINX_Domain.sh'
This commit is contained in:
@@ -23,23 +23,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
|
||||||
|
|
||||||
location = /netdata {
|
#netdata here
|
||||||
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 on;
|
||||||
gzip_proxied any;
|
gzip_proxied any;
|
||||||
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml;
|
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml;
|
||||||
@@ -120,14 +105,28 @@ ln -s /etc/nginx/sites-available/"$domain" /etc/nginx/sites-enabled/
|
|||||||
# Redirect phpmyadmin -> database
|
# Redirect phpmyadmin -> database
|
||||||
ln -s /usr/share/phpmyadmin /var/www/"$domain"/html/database
|
ln -s /usr/share/phpmyadmin /var/www/"$domain"/html/database
|
||||||
|
|
||||||
|
##-------------##
|
||||||
|
# Netdata #
|
||||||
|
##-------------##
|
||||||
|
|
||||||
|
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 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 }+g' /etc/nginx/sites-available/"$domain"
|
||||||
|
# systemctl stop netdata
|
||||||
|
# systemctl disable netdata
|
||||||
|
fi
|
||||||
|
|
||||||
##-------------##
|
##-------------##
|
||||||
# Certbot #
|
# Certbot #
|
||||||
##-------------##
|
##-------------##
|
||||||
|
|
||||||
#certbot --nginx -d $domain -d www.$domain
|
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/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/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"
|
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 #
|
# Wordpress #
|
||||||
|
|||||||
Reference in New Issue
Block a user