Add Nginx for Jellyfin on port 80

SSL will come later, this is for the LAN
This commit is contained in:
Gene Liverman 2023-12-20 20:09:50 -05:00
parent 27933aa42f
commit 020ae1b844
2 changed files with 36 additions and 4 deletions

View file

@ -17,6 +17,7 @@
jellyfin-ffmpeg
jellyfin-web
net-snmp
nginx
yt-dlp
];
@ -33,7 +34,7 @@
networking = {
# Open ports in the firewall.
firewall.allowedTCPPorts = [ 22 ];
firewall.allowedTCPPorts = [ 22 80 ];
# firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# firewall.enable = false;
@ -72,6 +73,37 @@
enable = true;
openFirewall = true;
};
nginx = {
enable = true;
virtualHosts."jellyfin" = {
default = true;
listen = [
{
addr = "0.0.0.0";
port = 80;
}
];
locations = {
"= /" = {
return = "302 http://$host/web/";
};
"/" = {
proxyPass = "http://127.0.0.1:8096";
recommendedProxySettings = true;
extraConfig = "proxy_buffering off;";
};
"= /web/" = {
proxyPass = "http://127.0.0.1:8096/web/index.html";
recommendedProxySettings = true;
};
"/socket" = {
proxyPass = "http://127.0.0.1:8096";
recommendedProxySettings = true;
proxyWebsockets = true;
};
};
};
};
tailscale = {
extraUpFlags = [
"--advertise-exit-node"