How can I hide a service behind a proxy with #Apache ?
from solarbrass@mastodon.uno to navidrome@discuss.tchncs.de on 23 May 2024 13:54
https://mastodon.uno/users/solarbrass/statuses/112490741328469969

How can I hide a service behind a proxy with #Apache ?
Like I have @navidrome running on standard port 4533 but I would like to Proxy it behind apache. So when I go to my website(dot)com/music I can reach it (as well with the apps so prolly websockets needs to be configured?).

I’m doing:
ProxyPass /music/ 127.0.0.1:4533/music/
ProxyPassReverse /music/ 127.0.0.1:4533/music/

But when i go to mywebsite(dot)com/music it goes to mywebsite(dot)com/app/

WTF?

Apache2 running on #debian

#navidrome

threaded - newest

breadsmasher@lemmy.world on 23 May 2024 14:10 next collapse

Does your configuration forward to (wildcard)/app on some default route?

solarbrass@mastodon.uno on 23 May 2024 14:14 collapse

@breadsmasher I would know how to answer you... What can I check?

breadsmasher@lemmy.world on 23 May 2024 14:18 collapse
ryan_harg@discuss.tchncs.de on 23 May 2024 20:01 collapse

just to clarify: you can access navidrome under 127.0.0.1:4533/music/? That part works?

solarbrass@mastodon.uno on 23 May 2024 20:03 collapse

@ryan_harg I access it without /music/
Just localhost:port

ryan_harg@discuss.tchncs.de on 23 May 2024 20:05 collapse

but your proxy config redirects to that path. That sounds wrong, then. unless I don’t get something here. (my reverse proxy is nginx, so …)

solarbrass@mastodon.uno on 23 May 2024 20:07 collapse

@ryan_harg I wanted to put the service under mysite/music

The music server works on mysite:port and stop. Can be this the issue?

ryan_harg@discuss.tchncs.de on 23 May 2024 20:08 collapse

i think you should loose the path on the right side.

solarbrass@mastodon.uno on 23 May 2024 20:10 collapse

@ryan_harg you mean I can’t use /music ?

ryan_harg@discuss.tchncs.de on 23 May 2024 20:12 collapse

well if navidrome doesn’t listen to it, then no. you can still use it on the Apache listening side: example.com/music/ redirecting to 127.0.0.1:4533 that is. Give it a try.

ryan_harg@discuss.tchncs.de on 23 May 2024 20:13 next collapse

you could also see if you notice requests arriving in the navidrome logs somewhere…

solarbrass@mastodon.uno on 23 May 2024 20:26 collapse

@ryan_harg well that was the goal I was trying to achieve... but unfortunately doesn’t work. Prolly with BaseUrl in the navidrome conf I can redirect to /music
Gonna try as soon I got home
Thanks

solarbrass@mastodon.uno on 23 May 2024 22:20 next collapse

@ryan_harg @breadsmasher I found I can configure a parameter on Navidrome settings called BaseUrl that allowed me to activate Navidrome server under /music so now the proxy works. Thanks a lot

ryan_harg@discuss.tchncs.de on 25 May 2024 20:31 collapse

did you succeed?

solarbrass@mastodon.uno on 25 May 2024 20:44 collapse

@ryan_harg yes. I changed Navidrome baseUrl to put it on /music and finally the Proxy/ReverseProxy worked