Compare commits
2 commits
440d87c7d2
...
d8d079953b
| Author | SHA1 | Date | |
|---|---|---|---|
| d8d079953b | |||
| d8857f46f9 |
2 changed files with 15 additions and 7 deletions
|
|
@ -2,11 +2,12 @@
|
||||||
services.vaultwarden = {
|
services.vaultwarden = {
|
||||||
enable = true;
|
enable = true;
|
||||||
config = {
|
config = {
|
||||||
DOMAIN = "pass.proxy.${homelab.domain}";
|
DOMAIN = "https://pass.proxy.${homelab.domain}";
|
||||||
SIGNUPS_ALLOWED = true;
|
|
||||||
ROCKET_ADDRESS = "127.0.0.1";
|
|
||||||
ROCKET_PORT = 8060;
|
ROCKET_PORT = 8060;
|
||||||
|
ROCKET_ADDRESS = "127.0.0.1";
|
||||||
ROCKET_LOG = "critical";
|
ROCKET_LOG = "critical";
|
||||||
|
DATA_FOLDER = "/mnt/data/vaultwarden";
|
||||||
|
SIGNUPS_ALLOWED = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{ homelab, lib, ... }: let
|
{ homelab, lib, ... }: let
|
||||||
base = "proxy.${homelab.domain}";
|
base = "proxy.${homelab.domain}";
|
||||||
proxy-mappings = {
|
hosts = {
|
||||||
"dns" = { dest = "http://localhost:8088"; auth = true; };
|
"dns" = { dest = "http://localhost:8088"; auth = true; };
|
||||||
"ai" = { dest = "http://localhost:8080"; auth = true; };
|
"ai" = { dest = "http://localhost:8080"; auth = true; };
|
||||||
|
|
||||||
|
|
@ -21,6 +21,10 @@
|
||||||
"cdn" = { dest = "http://localhost:3000"; auth = false; };
|
"cdn" = { dest = "http://localhost:3000"; auth = false; };
|
||||||
"@" = { dest = "http://localhost:5070"; auth = false; };
|
"@" = { dest = "http://localhost:5070"; auth = false; };
|
||||||
};
|
};
|
||||||
|
redirects = {
|
||||||
|
"www" = "https://proxy.${homelab.domain}";
|
||||||
|
"dash" = "https://${homelab.domain}";
|
||||||
|
};
|
||||||
in {
|
in {
|
||||||
users.users.nginx.extraGroups = [ "acme" ];
|
users.users.nginx.extraGroups = [ "acme" ];
|
||||||
security.acme = {
|
security.acme = {
|
||||||
|
|
@ -46,10 +50,13 @@ in {
|
||||||
useACMEHost = base;
|
useACMEHost = base;
|
||||||
locations."/".return = "404";
|
locations."/".return = "404";
|
||||||
};
|
};
|
||||||
} // lib.mapAttrs' (subdomain: cfg: lib.nameValuePair (if subdomain == "@" then base else "${subdomain}.${base}") {
|
} // lib.mapAttrs' (subdomain: cfg: lib.nameValuePair "${subdomain}.${base}" {
|
||||||
|
useACMEHost = base;
|
||||||
|
forceSSL = true;
|
||||||
|
locations."/".return = "301 https://${base}$request_uri";
|
||||||
|
}) redirects // lib.mapAttrs' (subdomain: cfg: lib.nameValuePair (if subdomain == "@" then base else "${subdomain}.${base}") {
|
||||||
useACMEHost = base;
|
useACMEHost = base;
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
|
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = cfg.dest;
|
proxyPass = cfg.dest;
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
|
|
@ -69,6 +76,6 @@ in {
|
||||||
client_max_body_size 50000M;
|
client_max_body_size 50000M;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}) proxy-mappings;
|
}) hosts;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue