Alisa/nix/infra/nginx.nix

36 lines
677 B
Nix
Raw Normal View History

2024-07-10 19:08:04 +02:00
{
...
}:
{
services.nginx = {
enable = true;
recommendedTlsSettings = true;
recommendedOptimisation = true;
recommendedGzipSettings = true;
recommendedProxySettings = true;
virtualHosts = {
"clan-war.net" = {
enableACME = true;
forceSSL = true;
};
"api.clan-war.net" = {
forceSSL = true;
enableACME = true;
locations."/".proxyPass = "http://localhost:8080";
};
};
};
security.acme = {
acceptTerms = true;
defaults.email = "security@clan-war.net";
};
networking.firewall = {
enable = true;
allowedTCPPorts = [ 80 ];
allowedUDPPorts = [ 80 ];
};
}