From 8427ac4b4f79d3de7fcdce1af24e765ea7d633ee Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Sat, 7 Jan 2023 17:55:22 +0100 Subject: [PATCH] Updating nginx config with gzip compression #437 --- docker/docker-compose/default/nginx.conf | 24 ++++++++++++++++++-- docker/docker-compose/with-mysql/nginx.conf | 25 ++++++++++++++++++--- 2 files changed, 44 insertions(+), 5 deletions(-) diff --git a/docker/docker-compose/default/nginx.conf b/docker/docker-compose/default/nginx.conf index aa348352..4e145f5b 100644 --- a/docker/docker-compose/default/nginx.conf +++ b/docker/docker-compose/default/nginx.conf @@ -36,6 +36,28 @@ http { ## gzip on; + gzip_proxied any; + gzip_comp_level 6; + gzip_types + text/css + text/plain + text/javascript + text/markdown + application/javascript + application/json + application/gpx+xml + application/x-javascript + application/xml + application/xml+rss + application/xhtml+xml + application/x-font-ttf + application/x-font-opentype + application/vnd.ms-fontobject + image/svg+xml + image/x-icon + application/rss+xml + application/atom_xml; + gzip_disable "MSIE [1-6]\.(?!.*SV1)"; ## @@ -53,8 +75,6 @@ http { server { server_name yourdomain.com; # CHANGE ME - gzip on; - # Only allow all methods (GET,POST,PUT,etc..) for root (/pgapi). # see https://github.com/bpatrik/pigallery2/issues/214 diff --git a/docker/docker-compose/with-mysql/nginx.conf b/docker/docker-compose/with-mysql/nginx.conf index adc6fd03..437e2931 100644 --- a/docker/docker-compose/with-mysql/nginx.conf +++ b/docker/docker-compose/with-mysql/nginx.conf @@ -36,6 +36,28 @@ http { ## gzip on; + gzip_proxied any; + gzip_comp_level 6; + gzip_types + text/css + text/plain + text/javascript + text/markdown + application/javascript + application/json + application/gpx+xml + application/x-javascript + application/xml + application/xml+rss + application/xhtml+xml + application/x-font-ttf + application/x-font-opentype + application/vnd.ms-fontobject + image/svg+xml + image/x-icon + application/rss+xml + application/atom_xml; + gzip_disable "MSIE [1-6]\.(?!.*SV1)"; ## @@ -53,9 +75,6 @@ http { server { server_name yourdomain.com; # CHANGE ME - gzip on; - - # Only allow all methods (GET,POST,PUT,etc..) for root (/pgapi). # see https://github.com/bpatrik/pigallery2/issues/214 location /pgapi {