-
-
Save AlchemistCamp/e29b0080fdd63b732ac52bb1a8a32c6c to your computer and use it in GitHub Desktop.
Instructions for Episode 70
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Top of file, in the main block, add the following | |
# Compress responses on-the-fly. | |
load_module modules/ngx_http_brotli_filter_module.so; | |
# Serve pre-compressed files. | |
# Both modules could be used separately | |
load_module modules/ngx_http_brotli_static_module.so; | |
# ... | |
# in the http block, after your gzip settings, add the following: | |
brotli on; | |
brotli_comp_level 4; | |
brotli_types text/plain text/css application/javascript application/json image/svg+xml application/xml+rss; | |
brotli_static on; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is to be run manually from the command line, not as a bash script | |
sudo apt-add-repository -y ppa:hda-me/nginx-stable | |
sudo apt-get update | |
sudo apt-get install brotli nginx nginx-module-brotli | |
# Ensure brotli is properly installed. After the following command, you should see: | |
# --add-dynamic-module=debian/extra/ngx_brotli | |
nginx -V 2>&1 | tr ' ' '\n' | grep brotli | |
sudo vi /etc/nginx/nginx.conf | |
# make changes | |
sudo systemctl restart nginx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment