adonis/config/http/default.nix
toufic ar e068960f5d
All checks were successful
/ deploy (push) Successful in 28s
enable php-fpm
2026-02-05 21:21:35 +02:00

47 lines
1 KiB
Nix

{config, ...}: let
customDomain = config.customOps.domain.fqdn;
in {
imports = [
./captiveportal.nix
./tor-snowflake.nix
];
networking.firewall.allowedTCPPorts = [80 443];
services.nginx = {
enable = true;
recommendedTlsSettings = true;
recommendedOptimisation = true;
recommendedGzipSettings = true;
recommendedUwsgiSettings = true;
recommendedProxySettings = true;
recommendedBrotliSettings = true;
sslCiphers = "AES256+EECDH:AES256+EDH:!aNULL";
virtualHosts.${customDomain} = {
default = true;
root = "/var/www/${customDomain}";
forceSSL = true;
enableACME = true;
};
};
services.phpfpm.pools.mypool = {
user = "nobody";
settings = {
"pm" = "dynamic";
"listen.owner" = config.services.nginx.user;
"pm.max_children" = 75;
"pm.start_servers" = 10;
"pm.min_spare_servers" = 5;
"pm.max_spare_servers" = 20;
};
};
security.acme = {
acceptTerms = true;
defaults.email = "security@${config.mailserver.fqdn}";
};
}