External SRT subtitles are not working w/ reverse proxy

I was told by a few people that adding this additional location block to the SWAG’s nginx config for plex fixes the issue with external subtitles:

location /library/streams/ {
    set $upstream_app plex;
    set $upstream_port 32400;
    set $upstream_proto http;
    proxy_pass $upstream_proto://$upstream_app:$upstream_port;

    proxy_pass_request_headers off;
}

I don’t have time to test it right now, so please let me know if it works and I’ll update this post later after I test it myself.

3 Likes

I wrote a bash script which runs mkvmerge from a docker container and adds the external subs to the MKV files…

hümm, this actually works!

I had to modify it a bit, to add the correct docker name in the

set $upstream_app plex; 

line, but after that I have again external subtitles and direct play

Thanks!

1 Like

Do you check if the subtitles are synced before you merge? I also have a bunch of scripts dealing with subtitles and mkv files.

I can’t believe it. I’ve been struggling for weeks trying to troubleshoot this issue, I didn’t imagine my reverse proxy was causing certain specific Plex players to stop displaying subtitles. I can’t thank whoever came up with this solution enough! Awesome work!

For those using nginx proxy manager (NPM).

  1. Add location in “Custom locations”
  2. Define it as: /library/streams/
  3. Set same scheme, forward hostname/ip, forward port as you set in the “Details” tab
  4. Click on the gear beside the location - add the following to the textbox below
    proxy_pass_request_headers off;
  5. Save
3 Likes

The marked fix does work, however looking into the logs I always see:

upstream sent duplicate header line: "Content-Length: 30652", previous value: "Content-Length: 30652" while reading response header from upstream

conntected to this issue. So, afaict it’s an issue of the plexserver sending to many headers. I’m curious as to how non-reverse-proxy users get around this or if the plex apps natively ignore duplicate headers and nginx is just stubbern and flags it as an error without processing any further

Found this post from 2023 with the same issue.
Duplicates: 1

Hi, the solution from @MasterTX worked for me too, I use plex behind LinuxServer.io SWAG Reverse Proxy, I tried to send a PR to include the mod in the sample config and tested it successfully, If anyone interested I appreciate a thumbs up Plex - Add proxy configuration for library streams by gianmarco-mameli · Pull Request #757 · linuxserver/reverse-proxy-confs · GitHub

This fixed an issue with my parents Plex!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.