Refactor local Nginx virtual hosts and update

...local hostnames
This commit is contained in:
Oliver Davies 2024-12-15 23:13:11 +00:00
parent 8e599c2ffd
commit db4cfbc518
7 changed files with 49 additions and 18 deletions

View file

@ -1,13 +1,11 @@
{ config, ... }:
{
services.nginx = {
enable = true;
virtualHosts = {
"gitea.localhost".locations."/".proxyPass = "http://localhost:2222/";
"immich.localhost".locations."/".proxyPass = "http://localhost:2283/";
"jellyfin.localhost".locations."/".proxyPass = "http://localhost:8096/";
"syncthing.localhost".locations."/".proxyPass = "http://localhost:8384/";
"tubearchivist.localhost".locations."/".proxyPass = "http://localhost:8000/";
};
};
}

View file

@ -4,14 +4,14 @@
services.audiobookshelf = {
enable = true;
host = "audiobookshelf.localhost";
host = "audiobookshelf.davies.home";
port = 4001;
};
services.nginx = {
enable = true;
virtualHosts."audiobookshelf.localhost" = {
virtualHosts."audiobookshelf.davies.home" = {
locations."/" = {
proxyPass = "http://localhost:${toString config.services.audiobookshelf.port}/";
proxyWebsockets = true;

View file

@ -2,18 +2,22 @@
with lib;
let
port = 2222;
in
{
options.features.homelab.gitea.enable = mkEnableOption "Enable gitea";
config = mkIf config.features.homelab.gitea.enable {
services.gitea = {
services = {
gitea = {
enable = true;
group = "media";
stateDir = "/mnt/media/gitea";
settings = {
server = {
HTTP_PORT = 2222;
HTTP_PORT = port;
};
service = {
@ -21,5 +25,12 @@ with lib;
};
};
};
nginx = {
enable = true;
virtualHosts."gitea.davies.home".locations."/".proxyPass = "http://localhost:${toString port}/";
};
};
};
}

View file

@ -18,5 +18,11 @@ with lib;
};
environment.systemPackages = [ pkgs.immich-cli ];
services.nginx = {
enable = true;
virtualHosts."immich.davies.home".locations."/".proxyPass = "http://localhost:${toString config.services.immich.port}/";
};
};
}

View file

@ -12,5 +12,11 @@ with lib;
group = "media";
configDir = "/mnt/media/jellyfin";
};
services.nginx = {
enable = true;
virtualHosts."jellyfin.davies.home".locations."/".proxyPass = "http://localhost:8096/";
};
};
}

View file

@ -7,6 +7,9 @@
with lib;
let
port = 8082;
in
{
options.features.homelab.pihole.enable = mkEnableOption "Enable pihole";
@ -36,7 +39,7 @@ with lib;
"53:53/tcp"
"53:53/udp"
"67:67/udp"
"8082:80/tcp"
"${toString port}:80/tcp"
];
log-driver = "journald";
@ -94,7 +97,7 @@ with lib;
};
services.nginx.virtualHosts."pihole.localhost" = {
locations."/".proxyPass = "http://localhost:8082/";
locations."/".proxyPass = "http://localhost:${toString port}/";
};
};
}

View file

@ -229,6 +229,7 @@ in
wantedBy = [ "docker-compose-tubearchivist-root.target" ];
};
systemd.services."docker-volume-tubearchivist_es" = {
path = [ pkgs.docker ];
@ -284,5 +285,11 @@ in
wantedBy = [ "multi-user.target" ];
};
services.nginx = {
enable = true;
virtualHosts."tubearchivist.davies.home".locations."/".proxyPass = "http://localhost:${toString port}/";
};
};
}