infra: add nginx
This commit is contained in:
parent
0f2280005f
commit
d3fcc67c26
2 changed files with 36 additions and 0 deletions
|
@ -15,6 +15,7 @@
|
|||
./system.nix
|
||||
./disk.nix
|
||||
./backend.nix
|
||||
./nginx.nix
|
||||
./users
|
||||
];
|
||||
|
||||
|
|
35
nix/infra/nginx.nix
Normal file
35
nix/infra/nginx.nix
Normal file
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
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 ];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue