<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.jb-vpn.uk/index.php?action=history&amp;feed=atom&amp;title=Troubleshooting%3APlex_Troubleshooting</id>
	<title>Troubleshooting:Plex Troubleshooting - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.jb-vpn.uk/index.php?action=history&amp;feed=atom&amp;title=Troubleshooting%3APlex_Troubleshooting"/>
	<link rel="alternate" type="text/html" href="https://wiki.jb-vpn.uk/index.php?title=Troubleshooting:Plex_Troubleshooting&amp;action=history"/>
	<updated>2026-08-14T16:10:55Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.5</generator>
	<entry>
		<id>https://wiki.jb-vpn.uk/index.php?title=Troubleshooting:Plex_Troubleshooting&amp;diff=267&amp;oldid=prev</id>
		<title>Josh: Uploaded documentation from markdown files</title>
		<link rel="alternate" type="text/html" href="https://wiki.jb-vpn.uk/index.php?title=Troubleshooting:Plex_Troubleshooting&amp;diff=267&amp;oldid=prev"/>
		<updated>2026-07-07T10:44:40Z</updated>

		<summary type="html">&lt;p&gt;Uploaded documentation from markdown files&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This guide covers remote access to Plex Media Server on the Synology NAS (&amp;lt;code&amp;gt;StrawberryNAS&amp;lt;/code&amp;gt;, VPN IP &amp;lt;code&amp;gt;10.8.0.2&amp;lt;/code&amp;gt;) via the Caddy reverse proxy at &amp;lt;code&amp;gt;https://plex.jb-vpn.uk&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Internet → plex.jb-vpn.uk:443 (HTTPS, Caddy on VPS)&lt;br /&gt;
         → 10.8.0.2:32400 (HTTP, Plex on Synology via OpenVPN)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plex is &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; exposed on port 32400 to the public internet. Remote access uses the reverse proxy on port 443, not Plex&amp;#039;s built-in Remote Access port forwarding.&lt;br /&gt;
&lt;br /&gt;
== Synology Plex settings ==&lt;br /&gt;
&lt;br /&gt;
In &amp;#039;&amp;#039;&amp;#039;Plex → Settings → Network&amp;#039;&amp;#039;&amp;#039; (show Advanced):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Setting || Value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Custom server access URLs&amp;#039;&amp;#039;&amp;#039; || &amp;lt;code&amp;gt;https://plex.jb-vpn.uk:443&amp;lt;/code&amp;gt; only&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;LAN Networks&amp;#039;&amp;#039;&amp;#039; || &amp;lt;code&amp;gt;192.168.1.0/255.255.255.0,10.8.0.0/255.255.255.0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Treat WAN IP As LAN Bandwidth&amp;#039;&amp;#039;&amp;#039; || Enabled&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Secure connections&amp;#039;&amp;#039;&amp;#039; || Preferred&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;List of IP addresses allowed without auth&amp;#039;&amp;#039;&amp;#039; || Empty&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Custom server access URLs — important ===&lt;br /&gt;
&lt;br /&gt;
* Use &amp;#039;&amp;#039;&amp;#039;only&amp;#039;&amp;#039;&amp;#039; the public HTTPS URL with explicit port &amp;lt;code&amp;gt;:443&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; add VPN or LAN URLs such as &amp;lt;code&amp;gt;http://10.8.0.2:32400&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;http://strawberrynas:32400&amp;lt;/code&amp;gt;. Plex publishes these to &amp;lt;code&amp;gt;plex.tv&amp;lt;/code&amp;gt; and remote clients will try unreachable addresses.&lt;br /&gt;
&lt;br /&gt;
* After changing this setting, restart Plex on the Synology and wait 2–5 minutes for &amp;lt;code&amp;gt;plex.tv&amp;lt;/code&amp;gt; to refresh.&lt;br /&gt;
&lt;br /&gt;
=== Remote Access page shows &amp;quot;not available&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
This is &amp;#039;&amp;#039;&amp;#039;expected&amp;#039;&amp;#039;&amp;#039;. Plex reports the home LAN IP (&amp;lt;code&amp;gt;192.168.1.21&amp;lt;/code&amp;gt;) and home public IP, but port 32400 is not forwarded on the home router or VPS. Remote access works through &amp;lt;code&amp;gt;https://plex.jb-vpn.uk&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
&lt;br /&gt;
== How to access Plex remotely ==&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Web&amp;#039;&amp;#039;&amp;#039;: &amp;lt;code&amp;gt;https://plex.jb-vpn.uk/web&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;https://app.plex.tv&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Apps&amp;#039;&amp;#039;&amp;#039;: Sign in to your Plex account; the server should appear once custom access URLs are correct&lt;br /&gt;
&lt;br /&gt;
At home, local access via &amp;lt;code&amp;gt;http://strawberrynas:32400&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;http://192.168.1.21:32400&amp;lt;/code&amp;gt; is fine. When testing remote access, use the public URL above — not the local hostname.&lt;br /&gt;
&lt;br /&gt;
== Caddy configuration ==&lt;br /&gt;
&lt;br /&gt;
Canonical config: &amp;lt;code&amp;gt;/etc/caddy/Caddyfile&amp;lt;/code&amp;gt; (also in &amp;lt;code&amp;gt;app.jb/docs/caddy/Caddyfile&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;lang-caddy&amp;quot;&amp;gt;&lt;br /&gt;
plex.jb-vpn.uk {&lt;br /&gt;
    reverse_proxy http://10.8.0.2:32400 {&lt;br /&gt;
        header_up Host {host}&lt;br /&gt;
        header_up X-Real-IP {remote_host}&lt;br /&gt;
        header_up X-Forwarded-For {remote_host}&lt;br /&gt;
        header_up X-Forwarded-Proto {scheme}&lt;br /&gt;
        header_up X-Forwarded-Host {host}&lt;br /&gt;
        header_up X-Forwarded-Port {server_port}&lt;br /&gt;
        header_up Upgrade {http.request.header.Upgrade}&lt;br /&gt;
        header_up Connection {http.request.header.Connection}&lt;br /&gt;
        header_down Location http://10.8.0.2:32400 https://plex.jb-vpn.uk&lt;br /&gt;
        header_down Location https://10.8.0.2:32400 https://plex.jb-vpn.uk&lt;br /&gt;
        header_down Location http://192.168.1.21:32400 https://plex.jb-vpn.uk&lt;br /&gt;
        header_down Location https://192.168.1.21:32400 https://plex.jb-vpn.uk&lt;br /&gt;
        header_down Location http://strawberrynas:32400 https://plex.jb-vpn.uk&lt;br /&gt;
        header_down Location https://strawberrynas:32400 https://plex.jb-vpn.uk&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Do not use &amp;lt;code&amp;gt;header_up X-Plex-&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Never&amp;#039;&amp;#039;&amp;#039; add lines like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;lang-caddy&amp;quot;&amp;gt;&lt;br /&gt;
header_up X-Plex-Token {http.request.header.X-Plex-Token}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plex clients send the auth token in the &amp;#039;&amp;#039;&amp;#039;query string&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;?X-Plex-Token=...&amp;lt;/code&amp;gt;). If the header is missing, Caddy still sends an empty &amp;lt;code&amp;gt;X-Plex-Token&amp;lt;/code&amp;gt; header upstream. Plex prefers the header over the query parameter and returns &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; / &amp;#039;&amp;#039;&amp;#039;Not Authorised&amp;#039;&amp;#039;&amp;#039; for library requests.&lt;br /&gt;
&lt;br /&gt;
Caddy forwards client headers by default; no explicit &amp;lt;code&amp;gt;X-Plex-&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;header_up&amp;lt;/code&amp;gt; lines are needed.&lt;br /&gt;
&lt;br /&gt;
After editing the Caddyfile:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;lang-bash&amp;quot;&amp;gt;&lt;br /&gt;
caddy validate --config /etc/caddy/Caddyfile&lt;br /&gt;
systemctl reload caddy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Common issues ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Not Authorised&amp;quot; when opening libraries (web) ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Cause&amp;#039;&amp;#039;&amp;#039;: Usually the empty &amp;lt;code&amp;gt;X-Plex-Token&amp;lt;/code&amp;gt; header bug above, or custom access URLs pointing at unreachable VPN/LAN addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Fix&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
# Remove &amp;lt;code&amp;gt;header_up X-Plex-*&amp;lt;/code&amp;gt; from the Caddy Plex block and reload Caddy.&lt;br /&gt;
# Set custom server access URLs to &amp;lt;code&amp;gt;https://plex.jb-vpn.uk:443&amp;lt;/code&amp;gt; only on the Synology.&lt;br /&gt;
# Hard-refresh the browser or use a private window at &amp;lt;code&amp;gt;https://plex.jb-vpn.uk/web&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Plex app shows server as &amp;quot;unreachable&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Cause&amp;#039;&amp;#039;&amp;#039;: Stale connection list from &amp;lt;code&amp;gt;plex.tv&amp;lt;/code&amp;gt;, or bad custom access URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Fix&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
# Confirm custom access URL is correct (see above).&lt;br /&gt;
# Force-quit and reopen the Plex app.&lt;br /&gt;
# Verify the proxy works: &amp;lt;code&amp;gt;curl -s https://plex.jb-vpn.uk/identity&amp;lt;/code&amp;gt; should return XML with &amp;lt;code&amp;gt;claimed=&amp;quot;1&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== 502 Bad Gateway from &amp;lt;code&amp;gt;plex.jb-vpn.uk&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Cause&amp;#039;&amp;#039;&amp;#039;: VPN tunnel down, Plex not running, or Plex restarting.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Fix&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;lang-bash&amp;quot;&amp;gt;&lt;br /&gt;
# On VPS&lt;br /&gt;
ping -c 2 10.8.0.2&lt;br /&gt;
nc -zv 10.8.0.2 32400&lt;br /&gt;
cat /var/log/openvpn-status.log&lt;br /&gt;
journalctl -u caddy -n 20 | grep -i plex&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Web UI loads but API calls fail (cross-origin) ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Symptom&amp;#039;&amp;#039;&amp;#039;: Browser referer shows &amp;lt;code&amp;gt;http://strawberrynas:32400&amp;lt;/code&amp;gt; but API calls go to &amp;lt;code&amp;gt;plex.jb-vpn.uk&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Cause&amp;#039;&amp;#039;&amp;#039;: Opening Plex locally while custom URLs point at the public proxy.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Fix&amp;#039;&amp;#039;&amp;#039;: For remote testing, use &amp;lt;code&amp;gt;https://plex.jb-vpn.uk/web&amp;lt;/code&amp;gt; only. Remove local URLs from custom server access URLs.&lt;br /&gt;
&lt;br /&gt;
== Verification ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;lang-bash&amp;quot;&amp;gt;&lt;br /&gt;
# Plex identity (no auth required)&lt;br /&gt;
curl -s https://plex.jb-vpn.uk/identity&lt;br /&gt;
&lt;br /&gt;
# VPN reachability&lt;br /&gt;
ping -c 2 10.8.0.2&lt;br /&gt;
curl -sI http://10.8.0.2:32400/web&lt;br /&gt;
&lt;br /&gt;
# Caddy logs&lt;br /&gt;
journalctl -u caddy -n 50 | grep -iE &amp;#039;plex|10\.8\.0\.2&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With a valid token, library access through the proxy should return XML (not 401):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;lang-bash&amp;quot;&amp;gt;&lt;br /&gt;
curl -s &amp;quot;https://plex.jb-vpn.uk/library/sections?X-Plex-Token=YOUR_TOKEN&amp;quot; | head&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Related documentation ==&lt;br /&gt;
&lt;br /&gt;
* [[Services:Current Services|Services:Current Services]] — Plex service inventory&lt;br /&gt;
&lt;br /&gt;
* [[Troubleshooting:Service Troubleshooting|Troubleshooting:Service Troubleshooting]] — general reverse proxy issues&lt;br /&gt;
&lt;br /&gt;
* [[Documentation:Integration|OpenVPN:Integration]] — VPN + Caddy integration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;br /&gt;
[[Category:Documentation/Troubleshooting]]&lt;/div&gt;</summary>
		<author><name>Josh</name></author>
	</entry>
</feed>