Set up a CDN for Plex with CloudFlare & NGINX

It’s not working here either (unsure which model we have, probably 2014 or 2015). I wonder if the older models of Samsung TVs don’t support the TLS encryption being forced by CloudFlare.

Aaand Bingo. I disabled CF routing and the server is now visible by the SmartTV client. Looks like your best option is going to be rolling your own reverse proxy on your own VPS where you can dictate the security headers if you want to keep the SmartTV and utilize a “CDN” of sorts.

1 Like

there is an option in the system menu of plex app on the JS model tv to allow secure connections im going to play around with when i get home.

i now worry that the vizio app might possibly not work from my brothers house as well, will have to check on that one.

I think the problem is not secure connections so to speak, the issue is that the SmartTV doesn’t support the level of encryption being forced by the cloudflare proxy. A bit of discussion here is what clued me in to the potential issue along with this issue present on PS4.

im thinking i will probably just roll back the changes all together, i have a hetzner box and dont have any issues streaming just have 5-6 second load time loading some files was hoping this would alleviate it but seems to cause more issues than its worth to figure them out! did not notice any decrease when pinging the server with cf enabled and disabled, its always 135ms average.

but it was nice to run through it and have it actually working for the most part

I wonder would this work with ipv6 ?

CloudFlare supports ipv6 as well as Plex. I see no reason why not :slight_smile:

my idea is as most servers have both ip v4 and 6 that use the 6 for something lol

This is a great howto but remember to add the ssl section also for step 4. Needs to be uncommented and the failover IP added.

We add an SSL block in plex.conf so this is not necessary.

Interesting because it didn’t start working for me until I did that. Wonder why? All my devices work now except my Nvidia Shield with Kodi and the plex add-on. Does anyone have any evidence of this being a problem with this particular setup?

Another quick question. What settings are needed to make Plexpy work again with this setup? I can’t figure that out just yet.

local address should still work. i think.

You might check the existing proxy config for Apache and plexpy to see if the address includes a base url, I can’t remember off the top of my head, but I think it does.

Just match the proxy pass and you should be good.

no using localhost works just fine with this setup just figured that out.

It seems the issue is resolved in version 17. I don’t know if you have much control over the Kodi version on shield, but you could try checking for updates.

so just learned/discovered doing this for a setup might not be ideal for sharing if you wish to log ip that people are using as it will log it as a local ip
using plexpy.

Hey guys, So it’s been a long time since I’ve done anything this technical and to be quite honest I’m very inexperienced when it comes to DNS and domains. I have my domain, have registered with cloudflare and moved the Name servers of domain over to cloudflare. How do I add my failover ip to subdomain ? Is this done through cloudflare, my host(Hetzner) or where I got my domain? Thanks for the help!

did you order the failover from hetzner? if so then you just add it to the cloudflare dns entries. then give it a subdomain so that you can set it up with the settings in this wiki.

I have finally gotten this to work. I can immediately tell a difference in speed from what I’ve been dealing with! Loading is significantly faster and the constant buffering issues I was dealing with seem non-existent. Thanks for the help and thanks for the wiki!

1 Like

My and my shares IPs are still being logged properly here.

Good to hear :slight_smile: