It’s not working because it is against Cloudflare’s ToS unfortunately.
First I would ask, do you really have to make Jellyfin publicly accessible?
If yes, are you able to setup a VPN (i.e. Wireguard) and access Jellyfin through that instead?
If you don’t want the VPN route then isolate the NPM and Jellyfin instance from the rest of your server infrastructure and run the setup you described (open ports directly to the NPM instance). That is how most people that don’t want to do Cloudflare are running public access to self hosted services. But first, ask yourself the questions above.
This is the only thing keeping me from moving everything from PhotoPrism to Immich. I have over 40,000 objects (photos and videos) on my server already. If I could somehow get immich up and going on and have immich “recognize” this giant directory of objects without having to reupload everything, I would switch tonight.
This video helped me most. I’m a visual learner so it was easier for me to follow this instead of a written guide. Just be careful when you are following along tutorials (especially those written more than ~9 months ago) because the majority use syntax for OpenSSL 1.1.1 but that version is now EOL. You will need to use OpenSSL 3.x syntax as it’s the currently supported version of OpenSSL.