infra/modules/nginx/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
865 B
Nix
Raw Normal View History

2024-05-08 20:57:07 +00:00
{
config,
lib,
pkgs,
self,
...
2023-10-28 13:31:44 +00:00
}:
let
acmeEmailAddress = config.pub-solar-os.adminEmail;
2023-10-28 13:31:44 +00:00
webserverGroup = "hakkonaut";
in
{
services.nginx = {
enable = true;
group = webserverGroup;
enableReload = true;
2023-10-28 19:12:33 +00:00
proxyCachePath.cache = {
enable = true;
};
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
appendHttpConfig = ''
# https://my.f5.com/manage/s/article/K51798430
proxy_headers_hash_bucket_size 128;
'';
appendConfig = ''
# Number of CPU cores
worker_processes 8;
'';
eventsConfig = ''
worker_connections 1024;
'';
2023-10-28 13:31:44 +00:00
};
2023-10-28 13:31:44 +00:00
security.acme = {
acceptTerms = true;
2023-10-28 14:25:48 +00:00
defaults.email = acmeEmailAddress;
2023-10-28 13:31:44 +00:00
};
2024-05-08 20:57:07 +00:00
networking.firewall.allowedTCPPorts = [
80
443
];
2023-10-28 13:31:44 +00:00
}