From caf1eb7d7b3082a6b3a335e59cdd5813b82f3966 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sun, 17 May 2020 17:03:00 +0200 Subject: git, wiki, website: Improve gzip support. --- roles/git/files/etc/nginx/sites-available/git | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'roles/git/files/etc/nginx') diff --git a/roles/git/files/etc/nginx/sites-available/git b/roles/git/files/etc/nginx/sites-available/git index 7ad765f..0aa4345 100644 --- a/roles/git/files/etc/nginx/sites-available/git +++ b/roles/git/files/etc/nginx/sites-available/git @@ -33,9 +33,13 @@ server { ssl_certificate_key ssl/git.fripost.org.key; include snippets/git.fripost.org.hpkp-hdr; + gzip on; + gzip_vary on; + gzip_min_length 256; + gzip_types application/javascript application/json application/xml image/svg+xml image/x-icon text/css text/plain; + location ^~ /static/ { alias /usr/share/cgit/; - expires 30d; } # disallow push over HTTP/HTTPS @@ -58,10 +62,11 @@ server { fastcgi_pass unix:/run/git-http-backend.socket; } + location = /robots.txt { root /usr/share/cgit; } + location = /favicon.ico { root /usr/share/cgit; } # send all other URLs to cgit location / { - gzip off; fastcgi_param SCRIPT_FILENAME /usr/lib/cgit/cgit.cgi; fastcgi_param PATH_INFO $uri; fastcgi_param CONTENT_TYPE $content_type; -- cgit v1.2.3