From 820ede4ac35807acce7fff6113bb9762629f40cd Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 27 Jul 2019 11:27:28 +0800 Subject: [PATCH] nixbld: optimize web server settings --- nixbld-etc-nixos/configuration.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nixbld-etc-nixos/configuration.nix b/nixbld-etc-nixos/configuration.nix index eef58c2..6d0d0d4 100644 --- a/nixbld-etc-nixos/configuration.nix +++ b/nixbld-etc-nixos/configuration.nix @@ -252,6 +252,7 @@ ACTION=="add", SUBSYSTEM=="tty", \ services.nginx = { enable = true; recommendedProxySettings = true; + recommendedGzipSettings = true; virtualHosts = let mainWebsite = { addSSL = true; @@ -260,8 +261,17 @@ ACTION=="add", SUBSYSTEM=="tty", \ extraConfig = '' error_page 404 /404.html; ''; + locations."^~ /fonts/".extraConfig = '' + expires 60d; + ''; + locations."^~ /js/".extraConfig = '' + expires 60d; + ''; locations."/MathJax" = { alias = "/var/www/MathJax"; + extraConfig = '' + expires 60d; + ''; }; # legacy URLs, redirect to avoid breaking people's bookmarks