diff --git a/CHANGES b/CHANGES index 2e45ae5bd..9896d85f2 100644 --- a/CHANGES +++ b/CHANGES @@ -1540,4 +1540,5 @@ [3.6.0] * Make reboot required check server side * Update node to 10.15.1 +* Enable gzip compression for large objects diff --git a/src/appconfig.ejs b/src/appconfig.ejs index d789e43be..33e37dbeb 100644 --- a/src/appconfig.ejs +++ b/src/appconfig.ejs @@ -90,6 +90,14 @@ server { add_header Referrer-Policy "no-referrer-when-downgrade"; proxy_hide_header Referrer-Policy; + # gzip responses that are > 50k and not images + gzip on; + gzip_min_length 50k; + gzip_types text/css text/javascript text/xml text/plain application/javascript application/x-javascript application/json; + + # enable for proxied requests as well + gzip_proxied any; + <% if ( endpoint === 'admin' ) { -%> # CSP headers for the admin/dashboard resources add_header Content-Security-Policy "default-src 'none'; connect-src wss: https: 'self' *.cloudron.io; script-src https: 'self' 'unsafe-inline' 'unsafe-eval'; img-src * data:; style-src https: 'unsafe-inline'; object-src 'none'; font-src https: 'self'; frame-ancestors 'none'; base-uri 'none'; form-action 'self';";