haccfiles/hosts/hainich/services/ghost_A20.nix

33 lines
823 B
Nix
Raw Normal View History

2020-11-27 20:56:20 +00:00
{ config, lib, pkgs, ... }:
{
2021-05-12 19:37:15 +00:00
virtualisation.oci-containers.containers."ghost-A20" = {
2020-11-27 20:56:20 +00:00
autoStart = true;
environment = {
2021-05-12 19:37:15 +00:00
url = "https://A20.4future.dev";
2020-11-27 20:56:20 +00:00
};
image = "ghost:alpine";
2021-05-12 19:37:15 +00:00
ports = [ "127.0.0.1:2369:2368" ];
volumes = [ "/run/A20:/var/lib/ghost/content" ];
2020-11-27 20:56:20 +00:00
};
2021-05-12 19:37:15 +00:00
fileSystems."/run/A20" =
{ device = "dpool/k8s/A20";
2020-11-27 20:56:20 +00:00
fsType = "zfs";
};
2021-05-12 19:37:15 +00:00
services.nginx.virtualHosts."A20.4future.dev" = {
2020-11-27 20:56:20 +00:00
enableACME = true;
forceSSL = true;
locations."/" = {
2021-05-12 19:37:15 +00:00
proxyPass = "http://127.0.0.1:2369";
2020-11-27 20:56:20 +00:00
extraConfig = "
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $http_host;
";
};
};
}