mirror of
https://github.com/thegeneralist01/config.git
synced 2026-03-09 18:30:01 +01:00
feat: set up cache
This commit is contained in:
parent
4c899bbfc6
commit
56cc86052f
6 changed files with 51 additions and 8 deletions
27
hosts/thegeneralist-central/cache/default.nix
vendored
Normal file
27
hosts/thegeneralist-central/cache/default.nix
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{ pkgs, config, ... }: let
|
||||
domain = "cache.thegeneralist01.com";
|
||||
|
||||
ssl = {
|
||||
quic = true;
|
||||
useACMEHost = "thegeneralist01.com";
|
||||
};
|
||||
in {
|
||||
age.secrets.cacheSigningKey.file = ./key.age;
|
||||
services.nix-serve = {
|
||||
enable = true;
|
||||
package = pkgs.nix-serve-ng;
|
||||
secretKeyFile = config.age.secrets.cacheSigningKey.path;
|
||||
port = 1337;
|
||||
openFirewall = false;
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts.${domain} = ssl // {
|
||||
locations."/".proxyPass = "http://127.0.0.1:1337";
|
||||
locations."= /".return = "301 https://thegeneralist01.com/404";
|
||||
|
||||
extraConfig = /* nginx */ ''
|
||||
proxy_intercept_errors on;
|
||||
error_page 404 = thegeneralist01.com/404.html;
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue