Move to vhost

This commit is contained in:
Giulio De Pasquale 2023-06-05 03:10:13 +02:00
parent b378975769
commit 2f43745162
3 changed files with 11 additions and 34 deletions

View File

@ -12,10 +12,10 @@ in
architect.vhost.${domain} = with config.architect.networks; { architect.vhost.${domain} = with config.architect.networks; {
dnsInterfaces = [ "lan" "wireguard" "tailscale" ]; dnsInterfaces = [ "lan" "wireguard" "tailscale" ];
locations."/" = { locations."/" = {
allowLan = true;
port = 6767; port = 6767;
deny = [ lan.devices.router.address ];
allow = [ allow = [
lan.net
wireguard.net wireguard.net
tailscale.net tailscale.net
]; ];

View File

@ -2,41 +2,18 @@
let let
domain = "htpro.giugl.io"; domain = "htpro.giugl.io";
utilities = import ./utilities.nix { inherit lib config; };
inherit (utilities) architectInterfaceAddress;
in in
{ {
services = { services.prowlarr.enable = true;
prowlarr.enable = true;
nginx.virtualHosts.${domain} = { architect.vhost.${domain} = {
forceSSL = true; dnsInterfaces = [ "tailscale" "wireguard" ];
enableACME = true;
locations."/" = {
proxyPass = "http://127.0.0.1:9696";
extraConfig = ''
allow ${config.architect.networks.lan.net};
allow ${config.architect.networks.tailscale.net};
deny all;
'';
};
# locations."/api" = { locations."/" = {
# proxyPass = "http://127.0.0.1:9696/prowlarr/api"; port = 9696;
# }; allowLan = true;
#
# locations."/Content" = {
# proxyPass = "http://127.0.0.1:9696/prowlarr/Content";
# };
}; };
}; };
networking.extraHosts = ''
${architectInterfaceAddress "lan"} ${domain}
${architectInterfaceAddress "wireguard"} ${domain}
${architectInterfaceAddress "tailscale"} ${domain}
'';
users.groups.media.members = [ "prowlarr" ]; users.groups.media.members = [ "prowlarr" ];
} }

View File

@ -10,12 +10,12 @@ in
}; };
architect.vhost.${domain} = with config.architect.networks; { architect.vhost.${domain} = with config.architect.networks; {
dnsInterfaces = [ "lan" "wireguard" "tailscale" ]; dnsInterfaces = [ "wireguard" "tailscale" ];
locations."/" = { locations."/" = {
port = 7878; port = 7878;
deny = [ lan.devices.router.address ]; allowLan = true;
allow = [ allow = [
lan.net
wireguard.net wireguard.net
tailscale.net tailscale.net
]; ];