Unable to access Jelyfin from internet -> UNRAID + Letsencrypt + Jellyfin

I cannot access Jellyfin server from www:

  1. In my smartphone when I enter https://jellyfin.mydomainname.com I get error: “Could not connect to server”
  2. In browser when I type: https://jellyfin.mydomainname.com I get error: 502 Bad Gateway, nginx/1.18.0

I cannot access WebGUI. “blank browser screen”

My setup:

  1. CNAME is correctly added.
  2. Letsencrypt docker (UNRAID):
    –file “jellyfin.subdomain.conf” exists with following configs:

***START
server {
listen 443 ssl;
listen [::]:443 ssl;

server_name jellyfin.*;

include /config/nginx/ssl.conf;

client_max_body_size 0;

location / {
    include /config/nginx/proxy.conf;
    resolver 127.0.0.11 valid=30s;
	
    set $upstream_app jellyfin;
    set $upstream_port 8096;
    set $upstream_proto http;
    proxy_pass $upstream_proto://$upstream_app:$upstream_port;

    proxy_set_header Range $http_range;
    proxy_set_header If-Range $http_if_range;
}
location ~ (/jellyfin)?/socket {
    include /config/nginx/proxy.conf;
    resolver 127.0.0.11 valid=30s;
    set $upstream_app jellyfin;
    set $upstream_port 8096;
    set $upstream_proto http;
    proxy_pass $upstream_proto://$upstream_app:$upstream_port;

}

}
***END
– Letsencrypt, when run, shows message “Server Ready”. Letsencrypt is used for many other docker apps without issues.

  1. Installed Jellyfin app from Apps Repository and mapped Movie folders. WebGUI cannot be accesed.

How is stated error message solved?

Do you see jellyfin mentioned in the logs for letsencrypt prior to the server ready? If not your config is wrong somewhere.