Just migrated my Plex (Synology Package originally) to docker (plexinc-pms/docker) and everything went fine apart from:
(A) Having to manually port forward (suspect because the docker container is running in bridge mode) - This is not really an issue and resolved.
(B) All incoming client requests to the docker server now log the external client IP address as the internal docker server IP (172.17.0.1) - This causes problems when monitoring usage with external apps such as PlexPy / PlexWatch etc…
Dec 03, 2017 11:53:16.787 [XYZ] DEBUG - Auth: authenticated user 1 as
Dec 03, 2017 11:53:16.787 [XYZ] DEBUG - Request: [172.17.0.1: (Subnet)] GET /status/sessions (8 live) TLS GZIP Signed-in Token ()
Dec 03, 2017 11:53:16.788 [XYZ] DEBUG - [Now] Adding 1 sessions.
Dec 03, 2017 11:53:16.793 [XYZ] DEBUG - Completed: [172.17.0.1:] 200 GET /status/sessions (7 live) TLS GZIP 5ms 1735 bytes (pipelined: 48)
I resolved (actually work-around) this by changing the docker network type to “host” rather than “bridge” and the plex logs then show the correct client IP but, this isn’t ideal as I’d rather run the container in “bridge” mode for more flexibility…
Any ideas how to get Plex to log the correct client IP to the logs when running in “bridge” mode?
All incoming client requests to the docker server now log the external client IP address as the internal docker server IP
Docker changes the from IP address when operating in bridge mode so the destination (Plex) does not see the correct (as in actual) source IP address in some cases. Also, bridged networking brings with it several complications which is why we tend to recommend host networking or macvlan.
If you require it to be operated in bridged mode, use a reverse proxy that sets the X-Forwarded-For header (see: https://de.wikipedia.org/wiki/X-Forwarded-For). You can find a nginx configuration here: https://forums.plex.tv/discussion/294332/how-to-setup-nginx-as-a-reverse-proxy-for-plex . I am using it with linuxserver/letsencrypt.
any chance you willing to share the command you used to start the docker run …
I want to do --net=host so have docker/plex listen on my sinology public IP and not a separate IP.
G
@ninja888plex said:
Just migrated my Plex (Synology Package originally) to docker (plexinc-pms/docker) and everything went fine apart from:
(A) Having to manually port forward (suspect because the docker container is running in bridge mode) - This is not really an issue and resolved.
(B) All incoming client requests to the docker server now log the external client IP address as the internal docker server IP (172.17.0.1) - This causes problems when monitoring usage with external apps such as PlexPy / PlexWatch etc…
Dec 03, 2017 11:53:16.787 [XYZ] DEBUG - Auth: authenticated user 1 as
Dec 03, 2017 11:53:16.787 [XYZ] DEBUG - Request: [172.17.0.1: (Subnet)] GET /status/sessions (8 live) TLS GZIP Signed-in Token ()
Dec 03, 2017 11:53:16.788 [XYZ] DEBUG - [Now] Adding 1 sessions.
Dec 03, 2017 11:53:16.793 [XYZ] DEBUG - Completed: [172.17.0.1:] 200 GET /status/sessions (7 live) TLS GZIP 5ms 1735 bytes (pipelined: 48)