2023-10-28 13:31:44 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
self,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
let
|
2024-05-08 17:47:47 +00:00
|
|
|
acmeEmailAddress = config.pub-solar-os.adminEmail;
|
2023-10-28 13:31:44 +00:00
|
|
|
webserverGroup = "hakkonaut";
|
|
|
|
in
|
|
|
|
{
|
2024-07-18 15:49:29 +00:00
|
|
|
users.users.nginx.extraGroups = [ webserverGroup ];
|
2024-07-17 16:50:06 +00:00
|
|
|
|
2023-10-28 13:31:44 +00:00
|
|
|
services.nginx = {
|
|
|
|
enable = true;
|
|
|
|
enableReload = true;
|
2023-10-28 19:12:33 +00:00
|
|
|
proxyCachePath.cache = {
|
|
|
|
enable = true;
|
|
|
|
};
|
2023-10-29 02:37:22 +00:00
|
|
|
recommendedGzipSettings = true;
|
|
|
|
recommendedOptimisation = true;
|
2023-10-28 19:42:01 +00:00
|
|
|
recommendedProxySettings = true;
|
2023-10-29 02:37:22 +00:00
|
|
|
recommendedTlsSettings = true;
|
2024-10-15 21:19:02 +00:00
|
|
|
resolver.addresses = [
|
|
|
|
# quad9.net
|
|
|
|
"9.9.9.9"
|
|
|
|
"149.112.112.112"
|
|
|
|
"[2620:fe::fe]"
|
|
|
|
"[2620:fe::9]"
|
|
|
|
];
|
2023-11-03 12:07:53 +00:00
|
|
|
appendHttpConfig = ''
|
2024-01-17 14:16:06 +00:00
|
|
|
# https://my.f5.com/manage/s/article/K51798430
|
|
|
|
proxy_headers_hash_bucket_size 128;
|
2023-11-03 12:07:53 +00:00
|
|
|
'';
|
2024-04-14 15:39:56 +00:00
|
|
|
appendConfig = ''
|
|
|
|
# Number of CPU cores
|
|
|
|
worker_processes 8;
|
|
|
|
'';
|
|
|
|
eventsConfig = ''
|
|
|
|
worker_connections 1024;
|
|
|
|
'';
|
2023-10-28 13:31:44 +00:00
|
|
|
};
|
2024-01-27 19:29:30 +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
|
|
|
};
|
|
|
|
|
|
|
|
networking.firewall.allowedTCPPorts = [
|
|
|
|
80
|
|
|
|
443
|
|
|
|
];
|
|
|
|
}
|