在 CentOS 上给 Jellyfin 开启 SSL,常见有 两种方式:
用 Nginx / Caddy 做 HTTPS,Jellyfin 本身只跑 HTTP。
sudo yum install nginx -y
sudo systemctl enable --now nginx
sudo yum install certbot python3-certbot-nginx -y
sudo certbot --nginx -d jellyfin.example.com
编辑配置:
sudo vi /etc/nginx/conf.d/jellyfin.conf
示例:
server {
listen 80;
server_name jellyfin.example.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name jellyfin.example.com;
ssl_certificate /etc/letsencrypt/live/jellyfin.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/jellyfin.example.com/privkey.pem;
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;
}
}
sudo nginx -t
sudo systemctl restart nginx
访问:
https://jellyfin.example.com
Jellyfin 支持直接绑定 HTTPS,但配置麻烦、证书更新不便。
cert.pemkey.pem编辑:
/etc/jellyfin/network.xml
示例:
<IsHttps>true</IsHttps>
<HttpsPort>8920</HttpsPort>
<CertificatePath>/etc/jellyfin/ssl/cert.pem</CertificatePath>
<CertificatePassword></CertificatePassword>
sudo systemctl restart jellyfin
访问:
https://IP:8920
✅ Nginx + Let’s Encrypt
❌ 直接用 Jellyfin SSL
如果你是 内网 / 无域名,我也可以教你用 自签名证书 或 Caddy 自动 HTTPS。