toomuchio / plex-nginx-reverseproxy

Configuration to serve Plex Media Center https://plex.tv using Nginx https://nginx.com
659 stars 94 forks source link

Roku 2 won't establish a direct connection #26

Closed skius closed 7 years ago

skius commented 7 years ago

When I block port 32400 and add cloudflare domains with port 80 and 443 to the Plex settings and set SSL to Preferred, Roku 2 (maybe more clients) can't directly connect anymore and will be relayed (with a slow connection).

Relay: http://i.imgur.com/165uiCL.jpg Plex Settings: http://i.imgur.com/xI4jL3P.jpg

The cloudflare proxy works on other clients, so far only Roku breaks.

I know this isn't an issue caused by this config (at least I think it's not) but maybe somebody else who stumbles upon this knows a fix for this.

toomuchio commented 7 years ago

Aww mannn I just closed all the active issues :'(

I can't confirm this as I don't have a Roku, try turn CF off and see if it works just with Nginx. And include some access logs if you could.

From my understanding Roku should work fine, I know others who have used it in the past with my config so I'm not sure what the issue is.

gdob commented 7 years ago

I have a Roku stick and it connects directly to the server (without CloudFlare). CloudFlare breaks the recent pause bug fix, though.

toomuchio commented 7 years ago

Sounds like a CloudFlare issue. CF was always a pro of reverse proxying but I personally chain my reverse proxy. So server in country x, to reverse proxy in country y,z,f. With GeoDNS, since I found CF wasn't very good in my region.

Unfortunately if you're going to use CF it's going to be limited by their Nginx configurations which wont have the read timeout set high, and presumably breaks Roku for whatever reason.

gdob commented 7 years ago

I currently use Plex and nginx reverse proxy on the same server and it’s working great, but I want to get a VPS on a better network to improve peering. How do you configure Plex to allow connections from the server where nginx is hosted? Do you add the nginx server IP to the list of IPs allowed without auth in Plex settings? Because if I enabled remote access then the clients would connect directly to the Plex server and bypass the proxy.

toomuchio commented 7 years ago

I just chain the nginx reverse proxy, so reverse proxy on the machine running plex, then a reverse proxy to that reverse proxy on my VPS.

toomuchio commented 7 years ago

No further details have been provided and I'm getting conflicting reports of this working. Probably a CloudFlare issue like the PS4.

Closing till more details are provided.

zmike808 commented 7 years ago

I've found that when my roku streaming stick had this issue, changing "Allow Fallback to Insecure Connections" from "never" to "always" would fix it.

I also disabled plex relay, but that's more of a personal preference not an actual fix.

toomuchio commented 6 years ago

That is mentioned in the README as well, enabling Insecure Connections. If you go via CloudFlare it often still breaks devices. It's the price you pay, as I've said this configuration was never aimed at allowing CF, it was a side benefit. Anybody taking their setup half seriously would chain connections with a 'custom CDN' like setup I think.

Using a public CDN like CloudFlare for streaming is inadvisable, there's no guaranteed bandwidth and you have zero control of edge node configurations which often undo all the optimizations in my configuration and break some devices.