more hosts in nginx
This commit is contained in:
parent
06bfbe85de
commit
d711859f23
8 changed files with 144 additions and 72 deletions
24
configs/containers/cube/nginx_container.nix
Normal file
24
configs/containers/cube/nginx_container.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ lib, pkgs, config, ... }: {
|
||||
|
||||
deployment = {
|
||||
targetHost = "10.10.0.1";
|
||||
targetPort = 22;
|
||||
targetUser = "root";
|
||||
tags = [ "cube" ];
|
||||
};
|
||||
networking = {
|
||||
hostName = "nginx";
|
||||
interfaces.eth0 = {
|
||||
ipAddress = "10.10.0.1";
|
||||
prefixLength = 16;
|
||||
};
|
||||
defaultGateway = {
|
||||
address = "10.10.0.254";
|
||||
interface = "eth0";
|
||||
};
|
||||
};
|
||||
imports = [
|
||||
../../container_config.nix
|
||||
../../services/nginx_cube.nix
|
||||
];
|
||||
}
|
||||
|
|
@ -19,6 +19,6 @@
|
|||
};
|
||||
imports = [
|
||||
../../container_config.nix
|
||||
../../services/nginx.nix
|
||||
../../services/nginx_netcup.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
29
configs/services/nginx_cube.nix
Normal file
29
configs/services/nginx_cube.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{ lib, pkgs, config, ... }:
|
||||
{
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
recommendedProxySettings = true;
|
||||
|
||||
virtualHosts = {
|
||||
"nas.cdaut.de" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://10.10.0.2";
|
||||
extraConfig = "
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection \"upgrade\";
|
||||
";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
security.acme = {
|
||||
acceptTerms = true;
|
||||
defaults.email = "acme@cdaut.de";
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||
}
|
||||
|
|
@ -46,6 +46,13 @@
|
|||
proxyPass = "http://10.0.0.6:3000";
|
||||
};
|
||||
};
|
||||
"tasks.flux-ka.de" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://10.0.0.6:3000";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue