ctucx.git: nixfiles

ctucx' nixfiles

commit aa17155978c3bae15c773b76cdc9ee84be745233
parent 4b5cdb9647f5b04a69b8f5f1964b5a36b0c155d1
Author: Leah (ctucx) <git@ctu.cx>
Date: Mon, 15 May 2023 19:28:36 +0200

machines/trabbi/git: disable caching for html files
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git a/machines/trabbi/git.nix b/machines/trabbi/git.nix
@@ -180,6 +180,15 @@ in {
           locations = {
             "@redir".return = "307 ../log.html";
             "~ '^/([a-zA-Z0-9_.]+)/commit/.*$'".extraConfig = "error_page 404 = @redir;";
+
+            "~* \.html$".extraConfig = ''
+              add_header Last-Modified $date_gmt;
+              add_header Cache-Control 'private no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
+              if_modified_since off;
+              expires off;
+              etag off;
+            '';
+
             "~ '^/[a-zA-Z0-9._-]+/raw'".extraConfig = ''
               types {
                 application/json                                 json;