modo-test

This commit is contained in:
catvayor 2024-06-21 13:46:57 +02:00
parent 5cc8688003
commit eb4634e71c
5 changed files with 161 additions and 25 deletions

View file

@ -128,26 +128,46 @@
};
};
in
{
enable = true;
virtualHosts =
builtins.mapAttrs (_: {vm, ...}: {
enableACME = true;
addSSL = true;
acmeFallbackHost = vm;
acmeFallbackRecommendedProxySettings = true;
locations."/" = {
recommendedProxySettings = true;
proxyPass = "https://${vm}/";
};
}) vhosts;
streamConfig = builtins.concatStringsSep "\n" (lib.mapAttrsToList (vhost: {vm, sshport}: ''
{
enable = true;
virtualHosts = builtins.mapAttrs (
_:
{ vm, ... }:
{
enableACME = true;
addSSL = true;
acmeFallbackHost = vm;
acmeFallbackRecommendedProxySettings = true;
locations."/" = {
recommendedProxySettings = true;
proxyPass = "https://${vm}/";
};
}
) vhosts;
streamConfig =
builtins.concatStringsSep "\n" (
lib.mapAttrsToList (
vhost:
{ vm, sshport }:
''
server {
listen ${toString sshport};
proxy_pass ${vm}:22;
}
''
) vhosts
)
+ ''
server {
listen ${toString sshport};
proxy_pass ${vm}:22;
listen 993;
proxy_pass 192.168.122.3:993;
}
'') vhosts);
};
server {
listen 465;
proxy_pass 192.168.122.3:465;
}
'';
};
# Open ports in the firewall.
networking.firewall = {
@ -156,6 +176,8 @@
53
80
443
465
993
];
allowedTCPPortRanges = [
{