2023-07-26, 12:47 PM
(This post was last modified: 2023-07-26, 06:04 PM by Afgin. Edited 1 time in total.)
Hello!
I want to start out by saying, that I'm no expert in domain setup or anything like that. I have once few years ago setup a jellyfin server with a https domain using Nginx. It didn't go smoothly. Took a lot of trial and error, but got it working eventually. Been working great these few years.
Now I am upgrading my setup since my last one was just a cheap old laptop. Also at the same I'm changing the domain to something cheaper.
Same trial and error going on again, but I can't for the life of me get it to work on my new setup.
URL directs to Nginx welcome page.
My (/etc/nginx/conf.d/jellyfin.conf) file is like this: ( jellyfin.example.com is changed in here because don't want to reveal the real url)
_______________________________________________
# Jellyfin hosted on https://DOMAIN_NAME/jellyfin
server {
listen 80;
listen [::]:80;
server_name jellyfin.example.com;
# Uncomment to redirect HTTP to HTTPS
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name jellyfin.example.com;
# You can specify multiple domain names if you want
#server_name jellyfin.local;
ssl_certificate /etc/letsencrypt/live/jellyfin.example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/jellyfin.example.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
add_header Strict-Transport-Security "max-age=31536000" always;
ssl_trusted_certificate /etc/letsencrypt/live/jellyfin.example.com/chain.pem;
ssl_stapling on;
ssl_stapling_verify on;
# use a variable to store the upstream proxy
# in this example we are using a hostname which is resolved via DNS
# (if you aren't using DNS remove the resolver line and change the variable to point to an IP address e.g
set $jellyfin jellyfin;
resolver 127.0.0.1 valid=30;
# Jellyfin
location /jellyfin {
return 302 $scheme/$host/jellyfin/;
}
location /jellyfin/ {
# Proxy main Jellyfin traffic
# The / at the end is significant.
# https://www.acunetix.com/blog/articles/a...d-attacks/
proxy_pass http://$jellyfin:8096;
proxy_pass_request_headers on;
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-Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
# Disable buffering when the nginx proxy gets very resource heavy upon streaming
proxy_buffering off;
}
}
____________________________________________________________________________________________
sudo systemctl status nginx.service
status give this error:
____________________________________________________________________________________________
heinä 26 15:09:19 localhost systemd[1]: Starting A high performance web server and a reverse proxy server...
heinä 26 15:09:19 localhost nginx[5292]: nginx: [warn] conflicting server name "jellyfin.example.com" on 0.0.0.0:80, ignored
heinä 26 15:09:19 localhost nginx[5292]: nginx: [warn] conflicting server name "jellyfin.example.com " on [::]:80, ignored
heinä 26 15:09:19 localhost nginx[5292]: nginx: [warn] conflicting server name "jellyfin.example.com " on 0.0.0.0:443, ignored
heinä 26 15:09:19 localhost nginx[5292]: nginx: [warn] conflicting server name "jellyfin.example.com " on [::]:443, ignored
heinä 26 15:09:19 localhost nginx[5293]: nginx: [warn] conflicting server name "jellyfin.example.com " on 0.0.0.0:80, ignored
heinä 26 15:09:19 localhost nginx[5293]: nginx: [warn] conflicting server name "jellyfin.example.com " on [::]:80, ignored
heinä 26 15:09:19 localhost nginx[5293]: nginx: [warn] conflicting server name "jellyfin.example.com " on 0.0.0.0:443, ignored
heinä 26 15:09:19 localhost nginx[5293]: nginx: [warn] conflicting server name "jellyfin.example.com " on [::]:443, ignored
heinä 26 15:09:19 localhost systemd[1]: Started A high performance web server and a reverse proxy server.
____________________________________________________________________________________________
So must be something wrong with the jellyfin.conf file?
Ports has been opened in my router for 80, 443, 8096, 8920
I can enter jellyfin through localhost:8096
In the network settings enabling https says this: To enable secure connections, you will need to supply a trusted SSL certificate, such as Let's Encrypt. Please either supply a certificate, or disable secure connections.
I have made the certificates with letsencrypt Certbot, and it was succesfull.
when trying to manually select the path for certficate in network settings it says "The path could not be found. Please ensure the path is valid and try again."
/etc/letsencrypt/live/jellyfin.example.com
I used this as path
(edit: later I managed to solve this by giving jellyfin access to that folder with: setfacl -m u:jellyfin:rx /etc/letsencrypt/live) Didn't bring any difference to the problem.
I hope someone can point me towards the mistake I have in here.
Really want this to get up and running.
Thank you in advance
To enable secure connections, you will need to supply a trusted SSL certificate, such as Let's Encrypt. Please either supply a certificate, or disable secure connections. To enable secure connections, you will need to supply a trusted SSL certificate, such as Let's Encrypt. Please either supply a certificate, or disable secure connections. o enable secure connections, you will need to supply a trusted SSL certificate, such as Let's Encrypt. Please either supply a certificate, or disable secure connections. To enable secure connections, you will need to supply a trusted SSL certificate, such as Let's Encrypt. Please either supply a certificate, or disable secure connections.
I want to start out by saying, that I'm no expert in domain setup or anything like that. I have once few years ago setup a jellyfin server with a https domain using Nginx. It didn't go smoothly. Took a lot of trial and error, but got it working eventually. Been working great these few years.
Now I am upgrading my setup since my last one was just a cheap old laptop. Also at the same I'm changing the domain to something cheaper.
Same trial and error going on again, but I can't for the life of me get it to work on my new setup.
URL directs to Nginx welcome page.
My (/etc/nginx/conf.d/jellyfin.conf) file is like this: ( jellyfin.example.com is changed in here because don't want to reveal the real url)
_______________________________________________
# Jellyfin hosted on https://DOMAIN_NAME/jellyfin
server {
listen 80;
listen [::]:80;
server_name jellyfin.example.com;
# Uncomment to redirect HTTP to HTTPS
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name jellyfin.example.com;
# You can specify multiple domain names if you want
#server_name jellyfin.local;
ssl_certificate /etc/letsencrypt/live/jellyfin.example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/jellyfin.example.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
add_header Strict-Transport-Security "max-age=31536000" always;
ssl_trusted_certificate /etc/letsencrypt/live/jellyfin.example.com/chain.pem;
ssl_stapling on;
ssl_stapling_verify on;
# use a variable to store the upstream proxy
# in this example we are using a hostname which is resolved via DNS
# (if you aren't using DNS remove the resolver line and change the variable to point to an IP address e.g
set $jellyfin 127.0.0.1
)set $jellyfin jellyfin;
resolver 127.0.0.1 valid=30;
# Jellyfin
location /jellyfin {
return 302 $scheme/$host/jellyfin/;
}
location /jellyfin/ {
# Proxy main Jellyfin traffic
# The / at the end is significant.
# https://www.acunetix.com/blog/articles/a...d-attacks/
proxy_pass http://$jellyfin:8096;
proxy_pass_request_headers on;
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-Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
# Disable buffering when the nginx proxy gets very resource heavy upon streaming
proxy_buffering off;
}
}
____________________________________________________________________________________________
sudo systemctl status nginx.service
status give this error:
____________________________________________________________________________________________
heinä 26 15:09:19 localhost systemd[1]: Starting A high performance web server and a reverse proxy server...
heinä 26 15:09:19 localhost nginx[5292]: nginx: [warn] conflicting server name "jellyfin.example.com" on 0.0.0.0:80, ignored
heinä 26 15:09:19 localhost nginx[5292]: nginx: [warn] conflicting server name "jellyfin.example.com " on [::]:80, ignored
heinä 26 15:09:19 localhost nginx[5292]: nginx: [warn] conflicting server name "jellyfin.example.com " on 0.0.0.0:443, ignored
heinä 26 15:09:19 localhost nginx[5292]: nginx: [warn] conflicting server name "jellyfin.example.com " on [::]:443, ignored
heinä 26 15:09:19 localhost nginx[5293]: nginx: [warn] conflicting server name "jellyfin.example.com " on 0.0.0.0:80, ignored
heinä 26 15:09:19 localhost nginx[5293]: nginx: [warn] conflicting server name "jellyfin.example.com " on [::]:80, ignored
heinä 26 15:09:19 localhost nginx[5293]: nginx: [warn] conflicting server name "jellyfin.example.com " on 0.0.0.0:443, ignored
heinä 26 15:09:19 localhost nginx[5293]: nginx: [warn] conflicting server name "jellyfin.example.com " on [::]:443, ignored
heinä 26 15:09:19 localhost systemd[1]: Started A high performance web server and a reverse proxy server.
____________________________________________________________________________________________
So must be something wrong with the jellyfin.conf file?
Ports has been opened in my router for 80, 443, 8096, 8920
I can enter jellyfin through localhost:8096
In the network settings enabling https says this: To enable secure connections, you will need to supply a trusted SSL certificate, such as Let's Encrypt. Please either supply a certificate, or disable secure connections.
I have made the certificates with letsencrypt Certbot, and it was succesfull.
when trying to manually select the path for certficate in network settings it says "The path could not be found. Please ensure the path is valid and try again."
/etc/letsencrypt/live/jellyfin.example.com
I used this as path
(edit: later I managed to solve this by giving jellyfin access to that folder with: setfacl -m u:jellyfin:rx /etc/letsencrypt/live) Didn't bring any difference to the problem.
I hope someone can point me towards the mistake I have in here.
Really want this to get up and running.
Thank you in advance
To enable secure connections, you will need to supply a trusted SSL certificate, such as Let's Encrypt. Please either supply a certificate, or disable secure connections. To enable secure connections, you will need to supply a trusted SSL certificate, such as Let's Encrypt. Please either supply a certificate, or disable secure connections. o enable secure connections, you will need to supply a trusted SSL certificate, such as Let's Encrypt. Please either supply a certificate, or disable secure connections. To enable secure connections, you will need to supply a trusted SSL certificate, such as Let's Encrypt. Please either supply a certificate, or disable secure connections.