https://jellyfin.org/docs/general/networking/nginx.html

#JellyFin
server {
    listen 80;
    listen [::]:80;
    server_name domain.com;

    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name domain.com;

    set $mediasrv http://127.0.0.1:8096;
    resolver 127.0.0.1 valid=30;

    ssl_certificate /etc/ssl/live/fullchain.pem;
    ssl_certificate_key /etc/ssl/live/privkey.pem;
    
    allow 192.168.1.0/24;
    deny all;

    location /.well-known/acme-challenge/ {
        root /var/www/html/acme;
        allow all;
    }

    location = / {
       return 302 https://$host/web/;
    }

    location / {
       proxy_pass $mediasrv;
       include                 /etc/nginx/conf.d/proxy.conf;
    }

    location = /web/ {
       proxy_pass $mediasrv/web/index.html;
       include                 /etc/nginx/conf.d/proxy.conf;
    }

    location /socket {
       proxy_pass $mediasrv;
       include                 /etc/nginx/conf.d/websocket-proxy.conf;
    }
}