FoxxMD / multi-scrobbler

Scrobble plays from multiple sources to multiple clients
https://foxxmd.github.io/multi-scrobbler
MIT License
346 stars 16 forks source link

Expose on different port via reverse proxy #109

Closed jkjustjoshing closed 10 months ago

jkjustjoshing commented 10 months ago

Please check the FAQ before submitting a bug report.

Describe the bug I have many web services running on my server. I have a reverse proxy sitting in front of all of them, and separate domain names for each. I have Multi Scrobbler at the domain multi-scrobbler.example.com, with SSL certificates and being served on port 443. However, I can't have the Docker container expose itself on port 443 because that's what my reverse proxy is listening on. So I need the Multi Scrobbler Docker container to listen on the default port 9078, but I need the port of the callback URLs (set via BASE_URL environment variable) to be 443 (or no port, with https protocol).

I can't figure out how to set the base URL and callback URLs to have a different port than the one the container listens on.

Versions (please complete the following information): Provide version information for any related sources/clients.

FoxxMD commented 10 months ago

Have you actually tried multi-scrobbler.example.com:443 as base url and attempted to authenticate? What errors or logging out do you get? Have you tried explicitly setting the redirect URI for the source/client you are trying to authenticate? (Which source/client?)

MS doesn't care (isn't checking) what the host name or port is as long as it gets the callback data to the correct route. The listening port doesn't matter to MS as long as it gets requests (which it does, through the reverse proxy). And the callback is done by your browser, rather than the individual service (lastfm, spotify) actually making a direct request to your server.

All MS cares is that it gets the callback request back to the correct route for it finish authentication. The callback url is used by spotify to make sure your browser is redirected to the correct url with the authentication data.

jkjustjoshing commented 10 months ago

About 5 minutes after I submitted this, I realized the issue. I'm 95% sure I replied explaining what my solution was and closing this issue, but clearly that didn't actually happen. My apologies!

I wasn't setting the SPOTIFY_REDIRECT_URI variable, so it was defaulting to sending Spotify a redirect URL of BASE_URL with port 9078 (which can't be redirected to since it's not an exposed port). Setting SPOTIFY_REDIRECT_URI with the correct port caused everything to start working! So sorry to have not closed this yesterday in a timely fashion. Thanks so much for making an awesome project!