basic nginx setup
This commit is contained in:
parent
800b243448
commit
7113bb629a
5 changed files with 116 additions and 55 deletions
23
configs/containers/nginx_container.nix
Normal file
23
configs/containers/nginx_container.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{ lib, pkgs, config, ... }: {
|
||||
|
||||
deployment = {
|
||||
targetHost = "10.0.0.2";
|
||||
targetPort = 22;
|
||||
targetUser = "root";
|
||||
};
|
||||
networking = {
|
||||
hostName = "nginx";
|
||||
interfaces.eth0 = {
|
||||
ipAddress = "10.0.0.2";
|
||||
prefixLength = 16;
|
||||
};
|
||||
defaultGateway = {
|
||||
address = "10.0.0.254";
|
||||
interface = "eth0";
|
||||
};
|
||||
};
|
||||
imports = [
|
||||
../container_config.nix
|
||||
../services/nginx.nix
|
||||
];
|
||||
}
|
||||
30
configs/services/nginx.nix
Normal file
30
configs/services/nginx.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{ lib, pkgs, config, ... }:
|
||||
{
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
|
||||
virtualHosts = {
|
||||
"pve.infra.cdaut.de" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "https://10.0.0.254:8006";
|
||||
};
|
||||
};
|
||||
"corerouter.infra.cdaut.de" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://10.0.0.1:80";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
security.acme = {
|
||||
acceptTerms = true;
|
||||
defaults.email = "acme@cdaut.de";
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue