Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Play movies under nginx proxy sometimes lag #1663

Closed
caoli5288 opened this issue Aug 23, 2019 · 12 comments
Closed

Play movies under nginx proxy sometimes lag #1663

caoli5288 opened this issue Aug 23, 2019 · 12 comments
Labels
bug Something isn't working

Comments

@caoli5288
Copy link

Describe the bug
When I streaming with reverse proxied url, the movie opens very slowly, gets stuck once in a while. And I can see some bad logs.

[01:07:15] [WRN] HTTP Response 206 to 192.168.2.148. Time (slow): 0:00:11.9331747. http://192.168.2.148/emby/Videos/6991382334f2b68c30d08e7fa9e0c380/stream.mp4?Static=true&mediaSourceId=6991382334f2b68c30d08e7fa9e0c380&deviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NDsgcnY6NjAuMCkgR2Vja28vMjAxMDAxMDEgRmlyZWZveC82MC4wfDE1NjY1NzM0NjA4Mjk1&Tag=0c842a5f97531f275c7d939359cb3595
[01:07:28] [WRN] HTTP Response 206 to 192.168.2.148. Time (slow): 0:00:25.1293684. http://192.168.2.148/emby/Videos/6991382334f2b68c30d08e7fa9e0c380/stream.mp4?Static=true&mediaSourceId=6991382334f2b68c30d08e7fa9e0c380&deviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NDsgcnY6NjAuMCkgR2Vja28vMjAxMDAxMDEgRmlyZWZveC82MC4wfDE1NjY1NzM0NjA4Mjk1&Tag=0c842a5f97531f275c7d939359cb3595

I installed jellyfin by docker run jellyfin:latest and config nginx like that.

    location /movies {
        return 302 $scheme://$host/movies/;
    }

    location /movies/ {
        # Proxy main Jellyfin traffic
        # The / at the end is significant.
        proxy_pass http://127.0.0.1:8096/;

        proxy_pass_request_headers on;

        proxy_set_header Host $host;

        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Host $http_host;

        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $http_connection;
    }

None of these problems exist when I access port 8096 directly. What should I do?
What else do I need to provide?

To Reproduce
Play under nginx proxied

Logs
See above

System (please complete the following information):

  • OS: Debian 9, install jellyfin by docker
  • Browser: Both firefox and chrome
  • Jellyfin Version: docker's latest image
  • Reverse proxy: nginx
@caoli5288 caoli5288 added the bug Something isn't working label Aug 23, 2019
@onny
Copy link

onny commented Aug 24, 2019

Hey,
so you access Jellyfin under the subdomain /movies? Is subdomain already supported by Jellyfin?

Best regards,
Jonas

@caoli5288
Copy link
Author

@JustAMan
Copy link
Contributor

Do you see any "slow movies" when accessing directly (not via nginx)? On the same connection, that is.
Also, anything funny in nginx logs?

@caoli5288
Copy link
Author

@JustAMan No "slow movies" while accessing directly.
and seems not anything funny in the nginx log.

@JustAMan
Copy link
Contributor

My wild guess here would be nginx trying to buffer something it shouldn't, that's why I asked about logs. I suggest you trying to disable buffering in nginx and see if it helps.

@caoli5288
Copy link
Author

@JustAMan
I follow this docs. Seems no buffer enabled.

Is this official docs?

@JustAMan
Copy link
Contributor

That one is the previous version, we moved docs.
See proxy_buffering off; in the up-to-date version: https://jellyfin.org/docs/general/administration/reverse-proxy.html#nginx

@caoli5288
Copy link
Author

@JustAMan THX. I'll try it next days.

@caoli5288
Copy link
Author

@JustAMan Solved. THX

@JustAMan
Copy link
Contributor

Could you please describe what helped you here, turning buffer off? For others' reference.
And if you no longer have the problem please close the issue. Thanks :)

@caoli5288
Copy link
Author

@JustAMan I add proxy_buffering off;. So you may needs to update documents under Nginx with subpath section. :)

@JustAMan
Copy link
Contributor

@caoli5288 please verify the docs issue I made. I'm going to close this issue as I see it's fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants