iv-org / invidious

Invidious is an alternative front-end to YouTube
https://invidious.io
GNU Affero General Public License v3.0
16.42k stars 1.85k forks source link

[Question] Dash video requests don't reflect port settings #4794

Closed leana8959 closed 4 months ago

leana8959 commented 4 months ago

Describe the bug Having invidious behind a reverse proxy, I noticed that the Dash quality mode doesn't work. HD720 works correctly.

I could see that the browser was sending requests to the wrong port (the proxied port 3001, not the external port 443). I have configured the external port to be 443, but that seem to have no effect on this behaviour.

wrong port browser

Steps to Reproduce

I use docker-compose on the plain example configuration (with port 3001) and run the container behind caddy.

caddy configuration I route invidious to localhost:3001 ```Caddyfile https://myawesome.domain.com { respond /robots.txt 200 { body "User-agent: * Disallow: /" } reverse_proxy localhost:3001 } ```
compose.yaml TL;DR: I changed the ports to 3001 ```yaml volumes: invidious_postgres: external: true services: invidious: image: quay.io/invidious/invidious:latest restart: unless-stopped ports: - "127.0.0.1:3001:3000" environment: INVIDIOUS_CONFIG: | db: dbname: invidious user: kemal password: kemal host: invidious_db port: 5432 check_tables: true https_only: true domain: myawesome.domain.com external_port: 443 registration_enabled: true hmac_key: "somekey" healthcheck: test: wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/comments/jNQXAC9IVRw || exit 1 interval: 30s timeout: 5s retries: 2 depends_on: - invidious_db invidious_db: image: docker.io/library/postgres:14 restart: unless-stopped volumes: - invidious_postgres:/var/lib/postgresql/data - ./config/sql:/config/sql - ./docker/init-invidious-db.sh:/docker-entrypoint-initdb.d/init-invidious-db.sh environment: POSTGRES_DB: invidious POSTGRES_USER: kemal POSTGRES_PASSWORD: kemal healthcheck: test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"] ```

Screenshots "The media could not be load, either because the server or network failed or because the format is not supported."

Safari gives a more detailed error message, showing that the request is going to port 3001 and not 443.

Additional context The problem can be reproduced both on Firefox and Safari

Thanks and have a nice day :)

nbuechner commented 4 months ago

I am affected by this too.

unixfox commented 4 months ago

Hello, this sounds like a configuration issue on your side.

As maintainers, we do not have a lot of free time so you should ask your question on our matrix channel or IRC.

Closing as it's a configuration issue on your side.

leana8959 commented 4 months ago

I have figured out the issue: I have confused the option port and external_port. Really sorry for the time it took to figure this out !

@nbuechner Maybe check if your external_port is configured correctly, I have it set to the reverse proxy's port, yet it should be 443.