marcopeocchi / yt-dlp-web-ui

A terrible web ui for yt-dlp. Designed to be self-hosted.
Mozilla Public License 2.0
657 stars 67 forks source link

Reverse proxy support broken for subdomains #114

Closed AdamantUnstable closed 6 months ago

AdamantUnstable commented 6 months ago

Steps to reproduce: 1) Host ytdlp-web-ui behind a reverse proxy using a subdomain rather than a sub path (eg ytdlp.home.lan or equivalent) 2) Load the web UI - get "An error has occurred" with a link to settings 3) Go to settings - the defaults are already correct with the correct subdomain and reverse proxy flag, so there's no settings to fix 4) It still doesn't work - attempting to go back to the main page just loads forever, refreshing goes back to the error page

Edit: this behaviour applies to the latest branch, on the master branch it just loads forever without even reaching the first error page

Baipyrus commented 6 months ago

Just set up for the first time, works perfectly for me. I use Nginx Proxy Manager and even run Authelia before reaching the WebUI.

marcopeocchi commented 6 months ago

@AdamantUnstable I'm encountering the same problem when authentication is enabled. With --auth removed everything works. Does nginx automatically pass cookies when configured as reverse proxy?

image

marcopeocchi commented 6 months ago

A possible soultion could be set the jwt in local storage. A solution that, for instance, navidrome uses.

But personally i prefer http only cookies.

marcopeocchi commented 6 months ago

Update

Now authentication uses headers instead of cookies and jwt is saved in localstorage. Should improve reverse proxy compability.