1
0
Fork 0

nixbld: optimize web server settings

This commit is contained in:
Sebastien Bourdeauducq 2019-07-27 11:27:28 +08:00
parent 049ef39c29
commit 820ede4ac3
1 changed files with 10 additions and 0 deletions

View File

@ -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