Skip to content

Commit c6604be

Browse files
authored
Change Nginx PPA (#88)
1 parent af50722 commit c6604be

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

lets-encrypt/activate-tls.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ fi
104104
# To get the correct version for the Nginx conf file
105105
check_php
106106

107+
# Check Brotli support
108+
if is_this_installed libnginx-mod-brotli
109+
then
110+
BROTLI_ON="brotli on;"
111+
fi
112+
107113
# Generate wordpress_tls_domain.conf
108114
if [ ! -f "$tls_conf" ]
109115
then
@@ -118,8 +124,10 @@ server {
118124
return 301 https://$TLSDOMAIN\$request_uri;
119125
}
120126
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
123131
124132
## Your website name goes here.
125133
server_name $TLSDOMAIN;

static/nginx.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
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+
15
user www-data;
26
worker_processes 2;
37
pid /run/nginx.pid;

wordpress_install.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ install_if_not build-essential
161161
# Needed for cron(tab)
162162
install_if_not cron
163163

164+
# For TAB completion
165+
install_if_not bash-completion
166+
164167
# Set DNS resolver
165168
# https://unix.stackexchange.com/questions/442598/how-to-configure-systemd-resolved-and-systemd-networkd-to-use-local-dns-server-f
166169
while :
@@ -246,13 +249,16 @@ run_script STATIC new_etc_mycnf
246249
install_if_not open-vm-tools
247250

248251
# Install Nginx
249-
check_command yes | add-apt-repository ppa:nginx/stable
252+
check_command yes | add-apt-repository ppa:ondrej/nginx
250253
apt update -q4 && spinner_loading
251254
install_if_not nginx
252255
sudo systemctl stop nginx.service
253256
sudo systemctl start nginx.service
254257
sudo systemctl enable nginx.service
255258

259+
# Enable Brotli
260+
install_if_not libnginx-mod-brotli
261+
256262
# Download TLSv 1.3 modified nginx.conf
257263
rm -f /etc/nginx/nginx.conf
258264
curl_to_dir "$STATIC" nginx.conf /etc/nginx/
@@ -542,8 +548,10 @@ then
542548
touch "$SITES_AVAILABLE/$TLS_CONF"
543549
cat << TLS_CREATE > "$SITES_AVAILABLE/$TLS_CONF"
544550
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;
547555
548556
## Your website name goes here.
549557
# server_name example.com;

0 commit comments

Comments
 (0)