2018-11-23 17:14:15 +01:00
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
# | Compression |
|
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
|
|
|
|
# https://nginx.org/en/docs/http/ngx_http_gzip_module.html
|
|
|
|
|
|
|
|
# Enable gzip compression.
|
|
|
|
# Default: off
|
|
|
|
gzip on;
|
|
|
|
|
|
|
|
# Compression level (1-9).
|
2019-05-15 18:38:05 +02:00
|
|
|
# 5 is a perfect compromise between size and CPU usage, offering about 75%
|
|
|
|
# reduction for most ASCII files (almost identical to level 9).
|
2018-11-23 17:14:15 +01:00
|
|
|
# Default: 1
|
|
|
|
gzip_comp_level 5;
|
|
|
|
|
2019-05-15 18:38:05 +02:00
|
|
|
# Don't compress anything that's already small and unlikely to shrink much if at
|
|
|
|
# all (the default is 20 bytes, which is bad as that usually leads to larger
|
|
|
|
# files after gzipping).
|
2018-11-23 17:14:15 +01:00
|
|
|
# Default: 20
|
|
|
|
gzip_min_length 256;
|
|
|
|
|
|
|
|
# Compress data even for clients that are connecting to us via proxies,
|
|
|
|
# identified by the "Via" header (required for CloudFront).
|
|
|
|
# Default: off
|
|
|
|
gzip_proxied any;
|
|
|
|
|
|
|
|
# Tell proxies to cache both the gzipped and regular version of a resource
|
|
|
|
# whenever the client's Accept-Encoding capabilities header varies;
|
|
|
|
# Avoids the issue where a non-gzip capable client (which is extremely rare
|
|
|
|
# today) would display gibberish if their proxy gave them the gzipped version.
|
|
|
|
# Default: off
|
|
|
|
gzip_vary on;
|
|
|
|
|
|
|
|
# Compress all output labeled with one of the following MIME-types.
|
2019-05-15 18:38:05 +02:00
|
|
|
# `text/html` is always compressed by gzip module.
|
2018-11-23 17:14:15 +01:00
|
|
|
# Default: text/html
|
|
|
|
gzip_types
|
|
|
|
application/atom+xml
|
2019-05-15 18:38:05 +02:00
|
|
|
application/geo+json
|
2018-11-23 17:14:15 +01:00
|
|
|
application/javascript
|
2019-08-12 21:21:20 +02:00
|
|
|
application/x-javascript
|
2018-11-23 17:14:15 +01:00
|
|
|
application/json
|
|
|
|
application/ld+json
|
|
|
|
application/manifest+json
|
2019-05-15 18:38:05 +02:00
|
|
|
application/rdf+xml
|
2018-11-23 17:14:15 +01:00
|
|
|
application/rss+xml
|
|
|
|
application/vnd.ms-fontobject
|
2019-05-15 18:38:05 +02:00
|
|
|
application/wasm
|
2018-11-23 17:14:15 +01:00
|
|
|
application/x-web-app-manifest+json
|
|
|
|
application/xhtml+xml
|
|
|
|
application/xml
|
2019-10-25 11:59:10 +02:00
|
|
|
font/eot
|
2018-11-23 17:14:15 +01:00
|
|
|
font/otf
|
2019-10-25 11:59:10 +02:00
|
|
|
font/ttf
|
2018-11-23 17:14:15 +01:00
|
|
|
image/bmp
|
|
|
|
image/svg+xml
|
2021-11-14 22:55:50 +01:00
|
|
|
image/vnd.microsoft.icon
|
|
|
|
image/x-icon
|
2018-11-23 17:14:15 +01:00
|
|
|
text/cache-manifest
|
2019-05-15 18:38:05 +02:00
|
|
|
text/calendar
|
2018-11-23 17:14:15 +01:00
|
|
|
text/css
|
|
|
|
text/javascript
|
2019-02-10 20:38:23 +01:00
|
|
|
text/markdown
|
2019-05-15 18:38:05 +02:00
|
|
|
text/plain
|
2019-08-12 21:21:20 +02:00
|
|
|
text/xml
|
2018-11-23 17:14:15 +01:00
|
|
|
text/vcard
|
|
|
|
text/vnd.rim.location.xloc
|
|
|
|
text/vtt
|
|
|
|
text/x-component
|
|
|
|
text/x-cross-domain-policy;
|