Add jellyfin

This commit is contained in:
Jakob Lechner 2023-05-02 22:49:23 +00:00
parent d156d3c286
commit 0bc5baa6ee
No known key found for this signature in database
GPG key ID: 996082EFB5906C10
2 changed files with 53 additions and 0 deletions

View file

@ -2,6 +2,7 @@
imports = [
./dnsmasq.nix
./dyndns.nix
./jellyfin.nix
./nginx.nix
./torrent.nix
./unifi-controller.nix

View file

@ -0,0 +1,52 @@
{ pkgs, ... }:
{
services.jellyfin = {
enable = true;
};
#networking.firewall = {
# interfaces."enp3s4".allowedTCPPorts = [ ];
#};
services.nginx.virtualHosts."jellyfin.jalr.de" = {
enableACME = true;
forceSSL = true;
kTLS = true;
extraConfig = ''
client_max_body_size 20m;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
location / {
proxy_pass http://127.0.0.1:8096;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Host $http_host;
proxy_buffering off;
}
location = /web/ {
proxy_pass http://127.0.0.1:8096/web/index.html;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Host $http_host;
}
location /socket {
proxy_pass http://127.0.0.1:8096;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Host $http_host;
}
'';
};
}