Skip to content

Commit 9ab85fa

Browse files
committed
Improve gzip settings.
1 parent 6e50828 commit 9ab85fa

File tree

1 file changed

+37
-3
lines changed

1 file changed

+37
-3
lines changed

run.sh

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,45 @@ http {
101101
keepalive_timeout 65;
102102
server_tokens off;
103103
104-
# gzip
104+
# gzip settings
105+
# Taken from https://github.com/h5bp/server-configs-nginx/blob/main/h5bp/web_performance/compression.conf
105106
gzip on;
107+
gzip_comp_level 5;
108+
gzip_min_length 256;
106109
gzip_proxied any;
107-
gzip_comp_level 6;
108-
gzip_buffers 16 8k;
110+
gzip_vary on;
111+
gzip_types
112+
application/atom+xml
113+
application/geo+json
114+
application/javascript
115+
application/x-javascript
116+
application/json
117+
application/ld+json
118+
application/manifest+json
119+
application/rdf+xml
120+
application/rss+xml
121+
application/vnd.ms-fontobject
122+
application/wasm
123+
application/x-web-app-manifest+json
124+
application/xhtml+xml
125+
application/xml
126+
font/eot
127+
font/otf
128+
font/ttf
129+
image/bmp
130+
image/svg+xml
131+
text/cache-manifest
132+
text/calendar
133+
text/css
134+
text/javascript
135+
text/markdown
136+
text/plain
137+
text/xml
138+
text/vcard
139+
text/vnd.rim.location.xloc
140+
text/vtt
141+
text/x-component
142+
text/x-cross-domain-policy;
109143
110144
# Rate limiting
111145
$ZONE

0 commit comments

Comments
 (0)