Setting up .local URLs

Hi,

I’ve spent a while installing mopidy with the MusicBox web interface on my Raspberry Pi (running Raspbian Jesse, not the MusicBox pre-baked distro). The last thing I’d like to set up is the “custom URL” (?) which I noticed the MusicBox distro uses. I’m not actually sure what it’s called, but right now I have to access the Mopidy server with [IP Address]:6680 and then click on musicbox_webclient, whereas the MusicBox distro allowed you to type musicbox.local into a browser address bar to go straight to the web interface. What handles this, and is there a quick guide to setting it up?

Thanks!

Musicbox 0.6 uses:

to redirect you to the correct port, and then Mopidy’s deprecated http/static_dir config parameter to point you to a particular static webclient (in this case /opt/webclient is a symbolic link to the webclient’s files).

However static_dir isn’t a great solution since it doesn’t work in some configurations and most Mopidy webclients are now dynamic Tornado web applications rather than static sites.

You can hack things up to work by having http/static_dir point to a simple static page that does a regular http redirection to whatever you want as proposed in https://github.com/pimusicbox/pimusicbox/issues/240#issuecomment-91679160.

In future Musicbox will use nginx as proxy to both redirect from port 80 to 6680 and redirect to a particular webclient. You can see the config here but it’s a bit more complicated and so arguably not worth it if you are happy with any of the above.

Thanks for the help, got it working as far as landing on the default mopidy page but if static_dir is deprecated I’ll hang on for a neater solution to get to specific webclients. Oddly even though my desktop can handle musicbox.local just fine my Android phone returns a ‘Server not found’ error [EDIT: bit of Googling has suggested that this is an Android issue and brought up a few solutions for that, I’ll give them a go.]