Stremio / server-docker

Builds and publishes Docker image for new releases of server.js
GNU General Public License v2.0
128 stars 23 forks source link

Https is not properly detected #42

Open lohmatij opened 2 weeks ago

lohmatij commented 2 weeks ago

I serve stremio server behind a reverse-proxy with https

My server is available at: https://stremio.server.com

if I open app.strem.io and specify https://stremio.server.com/ as my server then everything works perfectly

if I open https://stremio.server.com/ then the server is pre-populated to http://stremio.server.com/ (http instead of https) and the app doesn’t work.

If it’s not possible to detect http/https then I suggest to add a separate environment setting to provide a proper url.

yxtay commented 2 weeks ago

Which port did you forward to your reverse proxy? I think you need to forward the https port (12470) instead of the http port (11470) to ensure that the auto redirect. works.

This will probably also require you to skip the tls verify in your reverse proxy. Alternatively, you can generate the tls cert with the /get-https?ipAddress=<ip_address> route and use the self-signed certificate with the wildcard domain (*.519b6502d940.stremio.rocks). Replace * with your ip address (192-168-0-2, with dots replaced with dashes).

Alternatively, use this other docker image which has everything assembled. tsaridas/stremio-docker

As an example, this is in my Caddyfile. I am not familiar with other reverse proxy, so will not be able to help you.

    @stremio host stremio.{$DOMAIN}
    handle @stremio {
        reverse_proxy https://stremio:12470 {
            transport http {
                                # to use https transport to stremio container
                tls_server_name 192-168-0-2.519b6502d940.stremio.rocks
                                # alternatively to skip tls cert check
                                # tls_insecure_skip_verify
            }
        }
    }

The streaming server shows "Online" in my setup, but still jumps to "Error" at times, so I am not confident my configuration is working 100%.