From 17f9f874ba2f1b2f1adee0d9ae4c39ba84e803fd Mon Sep 17 00:00:00 2001
From: Leonidas Spyropoulos <artafinde@gmail.com>
Date: Tue, 4 May 2021 23:23:40 +0100
Subject: [PATCH] aurweb: Don't call PHP for serving static content

Closes: #318

Signed-off-by: Leonidas Spyropoulos <artafinde@gmail.com>
---
 roles/aurweb/templates/nginx.d.conf.j2 | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/roles/aurweb/templates/nginx.d.conf.j2 b/roles/aurweb/templates/nginx.d.conf.j2
index 5b5761235..a7f3c13e6 100644
--- a/roles/aurweb/templates/nginx.d.conf.j2
+++ b/roles/aurweb/templates/nginx.d.conf.j2
@@ -65,6 +65,12 @@ server {
         uwsgi_pass cgit;
     }
 
+    location ~ \.gz$ {
+        add_header Content-Type text/plain;
+        add_header Content-Encoding gzip;
+        expires 5m;
+    }
+
     location ~ ^/[^/]+\.php($|/) {
         fastcgi_pass   aurweb;
         fastcgi_index  index.php;
-- 
GitLab