File tree Expand file tree Collapse file tree 3 files changed +25
-5
lines changed Expand file tree Collapse file tree 3 files changed +25
-5
lines changed Original file line number Diff line number Diff line change 104
104
# To get the correct version for the Nginx conf file
105
105
check_php
106
106
107
+ # Check Brotli support
108
+ if is_this_installed libnginx-mod-brotli
109
+ then
110
+ BROTLI_ON=" brotli on;"
111
+ fi
112
+
107
113
# Generate wordpress_tls_domain.conf
108
114
if [ ! -f " $tls_conf " ]
109
115
then
@@ -118,8 +124,10 @@ server {
118
124
return 301 https://$TLSDOMAIN \$ request_uri;
119
125
}
120
126
server {
121
- listen 443 ssl http2;
122
- listen [::]:443 ssl http2;
127
+ listen 443 ssl;
128
+ listen [::]:443 ssl;
129
+ http2 on;
130
+ $BROTLI_ON
123
131
124
132
## Your website name goes here.
125
133
server_name $TLSDOMAIN ;
Original file line number Diff line number Diff line change
1
+ # https://docs.nginx.com/nginx/admin-guide/dynamic-modules/brotli/
2
+ load_module modules/ngx_http_brotli_filter_module.so; # for compressing responses on-the-fly
3
+ load_module modules/ngx_http_brotli_static_module.so; # for serving pre-compressed files
4
+
1
5
user www-data;
2
6
worker_processes 2;
3
7
pid /run/nginx.pid ;
Original file line number Diff line number Diff line change @@ -161,6 +161,9 @@ install_if_not build-essential
161
161
# Needed for cron(tab)
162
162
install_if_not cron
163
163
164
+ # For TAB completion
165
+ install_if_not bash-completion
166
+
164
167
# Set DNS resolver
165
168
# https://unix.stackexchange.com/questions/442598/how-to-configure-systemd-resolved-and-systemd-networkd-to-use-local-dns-server-f
166
169
while :
@@ -246,13 +249,16 @@ run_script STATIC new_etc_mycnf
246
249
install_if_not open-vm-tools
247
250
248
251
# Install Nginx
249
- check_command yes | add-apt-repository ppa:nginx/stable
252
+ check_command yes | add-apt-repository ppa:ondrej/nginx
250
253
apt update -q4 && spinner_loading
251
254
install_if_not nginx
252
255
sudo systemctl stop nginx.service
253
256
sudo systemctl start nginx.service
254
257
sudo systemctl enable nginx.service
255
258
259
+ # Enable Brotli
260
+ install_if_not libnginx-mod-brotli
261
+
256
262
# Download TLSv 1.3 modified nginx.conf
257
263
rm -f /etc/nginx/nginx.conf
258
264
curl_to_dir " $STATIC " nginx.conf /etc/nginx/
@@ -542,8 +548,10 @@ then
542
548
touch " $SITES_AVAILABLE /$TLS_CONF "
543
549
cat << TLS_CREATE > "$SITES_AVAILABLE /$TLS_CONF "
544
550
server {
545
- listen 443 ssl http2;
546
- listen [::]:443 ssl http2;
551
+ listen 443 ssl;
552
+ listen [::]:443 ssl;
553
+ http2 on;
554
+ brotli on;
547
555
548
556
## Your website name goes here.
549
557
# server_name example.com;
You can’t perform that action at this time.
0 commit comments