VEGAS: add nginx module
This commit is contained in:
parent
2514d708cd
commit
1339640547
2 changed files with 37 additions and 0 deletions
36
hosts/VEGAS/modules/nginx/default.nix
Normal file
36
hosts/VEGAS/modules/nginx/default.nix
Normal file
|
@ -0,0 +1,36 @@
|
|||
{ lib, config, tools, ... }:
|
||||
|
||||
let
|
||||
inherit (tools.meta) domain adminEmail;
|
||||
in
|
||||
with tools.nginx.vhosts;
|
||||
with tools.nginx.mappers;
|
||||
{
|
||||
security.acme.email = adminEmail;
|
||||
security.acme.acceptTerms = true;
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
recommendedProxySettings = true;
|
||||
recommendedTlsSettings = true;
|
||||
recommendedOptimisation = true;
|
||||
recommendedGzipSettings = true;
|
||||
proxyResolveWhileRunning = false;
|
||||
resolver = {
|
||||
addresses = [ "127.0.0.1" ];
|
||||
valid = "30s";
|
||||
};
|
||||
appendHttpConfig = ''
|
||||
server_names_hash_bucket_size 128;
|
||||
'';
|
||||
};
|
||||
services.phpfpm.pools.www = {
|
||||
inherit (config.services.nginx) user group;
|
||||
settings = {
|
||||
pm = "ondemand";
|
||||
"pm.max_children" = 16;
|
||||
"listen.owner" = config.services.nginx.user;
|
||||
"listen.group" = config.services.nginx.group;
|
||||
};
|
||||
};
|
||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||
}
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
# Plumbing
|
||||
./modules/database
|
||||
./modules/nginx
|
||||
]
|
||||
# TODO: fix users
|
||||
# ++ (import ../../users "server").groups.admin
|
||||
|
|
Loading…
Reference in a new issue