2
0
mirror of https://github.com/frappe/bench.git synced 2024-09-22 20:19:01 +00:00

[nginx] added gzip compression

This commit is contained in:
Anand Doshi 2016-04-28 15:38:43 +05:30
parent eb8fe5635f
commit e591574be0

View File

@ -10,9 +10,6 @@ server {
{% endfor -%}
;
client_max_body_size 4G;
keepalive_timeout 5;
sendfile on;
root {{ sites_path }};
{% if ssl_certificate and ssl_certificate_key %}
@ -60,6 +57,42 @@ server {
proxy_pass http://{{ bench_name }}-frappe;
}
# optimizations
sendfile on;
keepalive_timeout 15;
client_max_body_size 50m;
client_body_buffer_size 16K;
client_header_buffer_size 1k;
large_client_header_buffers 2 1k;
# enable gzip compresion
# based on https://mattstauffer.co/blog/enabling-gzip-on-nginx-servers-including-laravel-forge
gzip on;
gzip_http_version 1.1;
gzip_comp_level 5;
gzip_min_length 256;
gzip_proxied any;
gzip_vary on;
gzip_types
application/atom+xml
application/javascript
application/json
application/rss+xml
application/vnd.ms-fontobject
application/x-font-ttf
application/font-woff
application/x-web-app-manifest+json
application/xhtml+xml
application/xml
font/opentype
image/svg+xml
image/x-icon
text/css
text/plain
text/x-component
;
# text/html is always compressed by HttpGzipModule
}
{% if ssl_certificate and ssl_certificate_key %}