This repository has been archived on 2024-08-30. You can view files and clone it, but cannot push or open issues or pull requests.
infrastructure/hosts/carbon/services/nginx.nix
2024-05-29 17:15:20 +02:00

41 lines
828 B
Nix

{ pkgs, inputs, config, ... }:
{
services.nginx = {
enable = true;
virtualHosts = {
"www.${config.networking.domain}" = {
forceSSL = true;
enableACME = true;
locations."/" = {
root = pkgs.callPackage ../services/website/default.nix { };
};
};
"${config.networking.domain}" = {
forceSSL = true;
enableACME = true;
locations."/" = {
root = pkgs.callPackage ../services/website/default.nix { };
};
extraConfig = ''
error_page 404 /404.html;
deny 3.1.202.244;
deny 170.64.219.93;
deny 91.215.85.43;
client_max_body_size 900M;
'';
};
};
};
security.acme = {
acceptTerms = true;
defaults.email = "admin+acme@4o1x5.dev";
};
}