Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Plex behind CDN - how to setup?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Plex behind CDN - how to setup?

Hey guys,

How to setup plex behind cdn for a better streaming performance?

thanks!

«13

Comments

  • NekkiNekki Veteran

    I'm going to go out on a limb and say you don't have the budget to make this achievable. Video streaming CDNs are specialised, expensive products.

  • WSSWSS Member

    What about hacking up some turd behind red5 or whatever?

  • MasonRMasonR Community Contributor
    1. Purchase multiple VPS's or dedi's with varying locations depending on your streaming needs
    2. Set up a new Plex server on each service
    3. Upload all media content to Google drive or Amazon cloud unlimited account
    4. Use rclone to mount said drive/cloud on each VPS/dedi service
    5. Depending on where you are, select the closest Plex server within the app
    6. Live happily ever after
  • I'm using it by setting up apache proxypass

  • NekkiNekki Veteran

    redalertrox said: I'm using it by setting up apache proxypass

    How is that setup achieving 'better streaming performance'?

  • pbgbenpbgben Member, Host Rep

    BunnyCDN​ has a streaming service, good value.

    But you're going to have to write your own platform, plex won't support cdn.

    Thanked by 1mtsbatalha
  • TomTom Member

    I think I know what you're trying to do, route it through Cloudflare?

    I did it for a friend before, let me know..

  • MasonRMasonR Community Contributor

    @Yoda said:
    I think I know what you're trying to do, route it through Cloudflare?

    I did it for a friend before, let me know..

    Cloudflare isn't going to put videos on its CDN (for the free version, at least). Using cloudflare would just add even more latency since the network traffic would now be routed through a Cloudflare server.

  • @Yoda said:
    I think I know what you're trying to do, route it through Cloudflare?

    I did it for a friend before, let me know..

    I'd be interested in more info? I take it using a port that is proxied through plex, as there's a list of HTTPS ports plex will automatically proxy on the free plan?

  • It's hard enough to setup Plex with nginx as a proxy, can't imagine a cdn being a viable option.

  • pbgbenpbgben Member, Host Rep

    @rooter said:
    It's hard enough to setup Plex with nginx as a proxy, can't imagine a cdn being a viable option.

    Jeeeze, tell me about it. All so some uni students could bypass the dorm firewall. But why plex doesn't use 80:443 as the default I have no clue.

  • @adamluk said:

    @Yoda said:
    I think I know what you're trying to do, route it through Cloudflare?

    I did it for a friend before, let me know..

    I'd be interested in more info? I take it using a port that is proxied through plex, as there's a list of HTTPS ports plex will automatically proxy on the free plan?

    Just for those that may be interested, these have both helped me:

    https://plaza.quickbox.io/t/set-up-a-cdn-for-plex-with-cloudflare-nginx/2791

    https://www.reddit.com/r/PleX/comments/5ni728/plex_with_nginx_better_performance_and_everything/

  • trewqtrewq Administrator, Patron Provider

    Using a reverse proxy with Plex kind of removes half its useful features like sharing libraries with friends, all native apps and accessing it through plex.tv and not having to worry about your home IP.

  • @trewq said:
    Using a reverse proxy with Plex kind of removes half its useful features like sharing libraries with friends, all native apps and accessing it through plex.tv and not having to worry about your home IP.

    Actually you can still do all that and use Cloudflare. It obviously doesn't cache anything, but it CAN improve bad peering.

  • trewqtrewq Administrator, Patron Provider

    @SprkFade said:

    @trewq said:
    Using a reverse proxy with Plex kind of removes half its useful features like sharing libraries with friends, all native apps and accessing it through plex.tv and not having to worry about your home IP.

    Actually you can still do all that and use Cloudflare. It obviously doesn't cache anything, but it CAN improve bad peering.

    Only if you access it in your Web browser via the hostname. The apps will try and connect straight to the server.

    Thanked by 1pbgben
  • pbgbenpbgben Member, Host Rep

    @trewq said:

    @SprkFade said:

    @trewq said:
    Using a reverse proxy with Plex kind of removes half its useful features like sharing libraries with friends, all native apps and accessing it through plex.tv and not having to worry about your home IP.

    Actually you can still do all that and use Cloudflare. It obviously doesn't cache anything, but it CAN improve bad peering.

    Only if you access it in your Web browser via the hostname. The apps will try and connect straight to the server.

    Pretty much just going to help load the cover art faster.

  • @trewq said:

    @SprkFade said:

    @trewq said:
    Using a reverse proxy with Plex kind of removes half its useful features like sharing libraries with friends, all native apps and accessing it through plex.tv and not having to worry about your home IP.

    Actually you can still do all that and use Cloudflare. It obviously doesn't cache anything, but it CAN improve bad peering.

    Only if you access it in your Web browser via the hostname. The apps will try and connect straight to the server.

    Not true. The apps will connect over 80 or 443 just fine if you port block 32400 and publish the other urls/ports.

  • trewqtrewq Administrator, Patron Provider

    @SprkFade said:

    @trewq said:

    @SprkFade said:

    @trewq said:
    Using a reverse proxy with Plex kind of removes half its useful features like sharing libraries with friends, all native apps and accessing it through plex.tv and not having to worry about your home IP.

    Actually you can still do all that and use Cloudflare. It obviously doesn't cache anything, but it CAN improve bad peering.

    Only if you access it in your Web browser via the hostname. The apps will try and connect straight to the server.

    Not true. The apps will connect over 80 or 443 just fine if you port block 32400 and publish the other urls/ports.

    Do the apps not get the server's IP from the plex.tv servers and that is reported by the Plex server as whatever its outbound connection IP is?

  • @trewq said:

    @SprkFade said:

    @trewq said:

    @SprkFade said:

    @trewq said:
    Using a reverse proxy with Plex kind of removes half its useful features like sharing libraries with friends, all native apps and accessing it through plex.tv and not having to worry about your home IP.

    Actually you can still do all that and use Cloudflare. It obviously doesn't cache anything, but it CAN improve bad peering.

    Only if you access it in your Web browser via the hostname. The apps will try and connect straight to the server.

    Not true. The apps will connect over 80 or 443 just fine if you port block 32400 and publish the other urls/ports.

    Do the apps not get the server's IP from the plex.tv servers and that is reported by the Plex server as whatever its outbound connection IP is?

    They do, that's why you publish different urls and ports and plex.tv sends them to the clients. If you publish http://subdomain.domain.com and https://subdomain.domain.com:443 it will use those ports as long as you disable remote access and block port 32400 on the Plex server.

  • trewqtrewq Administrator, Patron Provider

    @SprkFade said:

    @trewq said:

    @SprkFade said:

    @trewq said:

    @SprkFade said:

    @trewq said:
    Using a reverse proxy with Plex kind of removes half its useful features like sharing libraries with friends, all native apps and accessing it through plex.tv and not having to worry about your home IP.

    Actually you can still do all that and use Cloudflare. It obviously doesn't cache anything, but it CAN improve bad peering.

    Only if you access it in your Web browser via the hostname. The apps will try and connect straight to the server.

    Not true. The apps will connect over 80 or 443 just fine if you port block 32400 and publish the other urls/ports.

    Do the apps not get the server's IP from the plex.tv servers and that is reported by the Plex server as whatever its outbound connection IP is?

    They do, that's why you publish different urls and ports and plex.tv sends them to the clients. If you publish http://subdomain.domain.com and https://subdomain.domain.com:443 it will use those ports as long as you disable remote access and block port 32400 on the Plex server.

    Ah, I didn't realise that was an option! That's awesome!

    For anyone wondering the docs for this feature are at https://support.plex.tv/hc/en-us/articles/200430283-Network under "Custom server access URLs".

  • TomTom Member

    @trewq said:

    @SprkFade said:

    @trewq said:

    @SprkFade said:

    @trewq said:

    @SprkFade said:

    @trewq said:
    Using a reverse proxy with Plex kind of removes half its useful features like sharing libraries with friends, all native apps and accessing it through plex.tv and not having to worry about your home IP.

    Actually you can still do all that and use Cloudflare. It obviously doesn't cache anything, but it CAN improve bad peering.

    Only if you access it in your Web browser via the hostname. The apps will try and connect straight to the server.

    Not true. The apps will connect over 80 or 443 just fine if you port block 32400 and publish the other urls/ports.

    Do the apps not get the server's IP from the plex.tv servers and that is reported by the Plex server as whatever its outbound connection IP is?

    They do, that's why you publish different urls and ports and plex.tv sends them to the clients. If you publish http://subdomain.domain.com and https://subdomain.domain.com:443 it will use those ports as long as you disable remote access and block port 32400 on the Plex server.

    Ah, I didn't realise that was an option! That's awesome!

    For anyone wondering the docs for this feature are at https://support.plex.tv/hc/en-us/articles/200430283-Network under "Custom server access URLs".

    Do note that, whilst most apps support it, a select few don't. In my experience the LG smart tv "webOS" app doesn't support it but if you leave port 32400 open then it will fall back.


    I can write up a tutorial later today setting Plex up as a frontend to Plex if anyone wishes - it shouldn't be classed as a cdn, rather a way to hide your IP and get better peering.

    Thanked by 1mtsbatalha
  • ardaarda Member

    https://github.com/toomuchio/plex-nginx-reverseproxy

    Plus any cdn you'd prefer. Make sure you read both the readme and comments on configuration file.

  • If your budget within LEB limit forget it

  • trewqtrewq Administrator, Patron Provider

    This could be super useful for spreading the upload over multiple connections. I normally have about 6 active streams from my Plex server and it's starting to push the limits of my bandwidth. I'll have something to think about!

  • As mentioned in this post earlier, this can be done but won't be utilizing a CDN to send content to any apps (roku, android, apple, etc). Only by accessing via web.

    If this was possible I'd be doing it already since I have up to 30 to 50 streams at the same time which a CDN would help out a lot.

    I'd recommend looking into emby which doesn't force the use of a cloud based user management. Then you might be able to do a full front CDN to improve streaming performance.

  • george_zipgeorge_zip Member
    edited March 2017

    @doughnet said:
    As mentioned in this post earlier, this can be done but won't be utilizing a CDN to send content to any apps (roku, android, apple, etc). Only by accessing via web.

    If this was possible I'd be doing it already since I have up to 30 to 50 streams at the same time which a CDN would help out a lot.

    I'd recommend looking into emby which doesn't force the use of a cloud based user management. Then you might be able to do a full front CDN to improve streaming performance.

    It actually works. I just set up the Nginx config that was posted in this thread with CloudFlare and it seems to improve speeds from Hetzner to Canada. I can access from the web UI, iOS and Roku without problems. See “Custom server access URLs” on this link: https://support.plex.tv/hc/en-us/articles/200430283-Network.

  • ardaarda Member

    That github nginx repo + CloudFlare CDN actually fixed my speed issue from my server in Canada to Eastern EU on both desktop app and Android. Just make sure you set the custom endpoint from plex settings and block external access from 32400 plex port from iptables / ufw / whatever you're using.

  • trewqtrewq Administrator, Patron Provider

    What sort of performance increase are people seeing? Is it just due to better routing?

  • george_zipgeorge_zip Member
    edited March 2017

    arda said: block external access from 32400 plex port from iptables / ufw

    You mean doing something like ufw deny out 32400?

    trewq said: What sort of performance increase are people seeing? Is it just due to better routing?

    I see speed bursts, it reaches my max home internet speed faster than without using CloudFlare. I guess better peering? I have 20Mbit download and I see 80Mbit outgoing bursts on the server when I start streaming video.

  • @Yoda said:

    @trewq said:

    @SprkFade said:

    @trewq said:

    @SprkFade said:

    @trewq said:

    @SprkFade said:

    @trewq said:
    Using a reverse proxy with Plex kind of removes half its useful features like sharing libraries with friends, all native apps and accessing it through plex.tv and not having to worry about your home IP.

    Actually you can still do all that and use Cloudflare. It obviously doesn't cache anything, but it CAN improve bad peering.

    Only if you access it in your Web browser via the hostname. The apps will try and connect straight to the server.

    Not true. The apps will connect over 80 or 443 just fine if you port block 32400 and publish the other urls/ports.

    Do the apps not get the server's IP from the plex.tv servers and that is reported by the Plex server as whatever its outbound connection IP is?

    They do, that's why you publish different urls and ports and plex.tv sends them to the clients. If you publish http://subdomain.domain.com and https://subdomain.domain.com:443 it will use those ports as long as you disable remote access and block port 32400 on the Plex server.

    Ah, I didn't realise that was an option! That's awesome!

    For anyone wondering the docs for this feature are at https://support.plex.tv/hc/en-us/articles/200430283-Network under "Custom server access URLs".

    Do note that, whilst most apps support it, a select few don't. In my experience the LG smart tv "webOS" app doesn't support it but if you leave port 32400 open then it will fall back.


    I can write up a tutorial later today setting Plex up as a frontend to Plex if anyone wishes - it shouldn't be classed as a cdn, rather a way to hide your IP and get better peering.

    I'm interested, thanks.

Sign In or Register to comment.