Unable to access server behind Caddy from plex app (android)

Hello everyone!
I’m try to setup my plex server behind a Caddy server.
I have disabled https configuration in my plex server settings…

Secure connections: Disabled

…and configured my Caddyfile (on the same machine) this way:

https://mydomain:443 {
  header {
    header_upstream Host {host}
    header_upstream X-Real-IP {remote}
    header_upstream X-Forwarded-For {remote}
    header_upstream X-Forwarded-Proto {scheme}
    header_upstream X-Forwarded-Host {host}
    header_upstream X-Forwarded-Ssl {on}
  }
  reverse_proxy http://127.0.0.1:32400 {
    flush_interval -1
  }
  log {
    output stdout
  }
}

When I try to connect from the outside using web browser, everything works fine.
But when I try to connect from using app (Android), connection fails.

Any idea ?

Thanks

EDIT: Here my app logs…

06-30 17:25:33.295  i: [Boot] FragmentWithBehavioursDelegate took 0ms to run create behaviours.
06-30 17:25:33.300  i: Fetching [method:GET] http://192.168.1.10:32400/hubs/sections/13?count=20&includeEmpty=1&includeExternalMetadata=1&includeLibraryPlaylists=1&includeRecentChannels=1&includeStations=1&includeTrailers=1&includeTypeFirst=1&libraryHubsOnly=1&X-Plex-Token=...V5x1
06-30 17:25:33.345  e: Presenter not found! Type: unknown, Subtype: unknown
06-30 17:25:43.904  i: [pms] /192.168.43.244:35916 - GET /logging
06-30 17:25:51.971  i: [pms] /192.168.43.244:35920 - GET /logging
06-30 17:25:53.407  i: Time out fetching http://192.168.1.10:32400/hubs/sections/13?count=20&includeEmpty=1&includeExternalMetadata=1&includeLibraryPlaylists=1&includeRecentChannels=1&includeStations=1&includeTrailers=1&includeTypeFirst=1&libraryHubsOnly=1&X-Plex-Token=...5x1.
06-30 17:25:53.409  i: [ServerManager] Updating reachability of 1 devices. Reason: hub refresh failed. Force: true.
06-30 17:25:53.410  i: [ServerTests] Scheduling job to test snakeberry. Reason: updateReachability (hub refresh failed).
06-30 17:25:53.447  i: [Boot] FragmentWithBehavioursDelegate took 0ms to run create behaviours.
06-30 17:25:53.546  e: Presenter not found! Type: unknown, Subtype: unknown
06-30 17:25:54.415  i: Fetching [method:GET] http://192.168.1.10:32400/media/providers?includePreferences=1&X-Plex-Token=...V5x1
06-30 17:25:54.464  i: Fetching [method:GET] http://<my_public_ip>:<my_external_port>/media/providers?includePreferences=1&X-Plex-Token=...V5x1
06-30 17:25:54.568  i: Time out fetching http://<my_public_ip>:<my_external_port>/media/providers?includePreferences=1&X-Plex-Token=...5x1.
06-30 17:25:54.569  w: [MediaProvidersApiClient] snakeberry Couldn't fetch providers. Result: Error (null)
06-30 17:25:55.979  i: [UserAction] Select menu item: Up.
06-30 17:25:57.599  i: [UserAction] Drawer header action clicked: (Settings)
06-30 17:26:01.322  i: ------------------------------
06-30 17:26:01.323  i: Hello, Plex for Android world (debug: false)!
06-30 17:26:01.324  i: App version: 8.2.1.18636 (807701697)
06-30 17:26:01.325  i: Nano server version: 1.18.8.2640-331fefba6
06-30 17:26:01.325  i: Manufacturer: samsung  Device: a7y18lte  Model: SM-A750FN  Product: a7y18ltexx  Version: 10
06-30 17:26:01.329  i: Screen size: Normal Screen density: Unknown Resolution: 2220x1080 DPI: 420 Touchscreen: true  Marketplace: com.android.vending  Architecture: arm64-v8a
06-30 17:26:01.330  i: Showing toast: Il Network Logging è partito
06-30 17:26:09.444  i: Time out fetching http://192.168.1.10:32400/media/providers?includePreferences=1&X-Plex-Token=...5x1.
06-30 17:26:09.445  w: [MediaProvidersApiClient] snakeberry Couldn't fetch providers. Result: Error (null)
06-30 17:26:16.423  i: [pms] /192.168.43.244:35572 - GET /logging

I’ve changed my configuration…

https://mydomain:myport {
  header {
    header_up Host {http.request.host}
    header_up X-Real-IP {http.request.remote}
    header_up X-Forwarded-For {http.request.remote}
    header_up X-Forwarded-Port {http.request.port}
    header_up X-Forwarded-Proto {http.request.scheme}
  }
  reverse_proxy https://127.0.0.1:32400 {
    transport http {
      tls_insecure_skip_verify
    }
    flush_interval -1
  }
  log {
    output file /var/log/caddy/plex.log {
      roll_size     5MiB
      roll_keep     2
      roll_keep_for 48h
    }
  }
}

And I’ve got 2 problems…

  1. when I open https://mydomain:myport I get
Jul 01 02:15:34 snakeberry caddy[9904]: 2020/07/01 02:15:34 http: TLS handshake error from 5.***.247.***:59075: no certificate available for 'myexternalip.83d59ede4bca4030b580296e54644c81.plex.direct'

and in Network configuration I’ve got this…
image

  1. When I try to connect from outside with Plex app (android) I’ve got this…
07-01 02:12:07.149  i: Fetching [method:GET] https://myexternalip.83d59ede4bca4030b580296e54644c81.plex.direct:myport/media/providers?includePreferences=1&X-Plex-Token=...V5x1
07-01 02:12:07.307  w: [MediaProvidersApiClient] snakeberry Couldn't fetch providers. Result: Error (null)

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