mopidy-musicbox-webclient: Webclient broken if placed behind reverse proxy

In my setup, the mopidy server is made available through a reverse proxy (nginx) such that the mopidy root is available under https://domain/mopidy, i.e., the web clients are available as

  • https://domain/mopidy/musicbox_webclient/
  • https://domain/mopidy/moped/

The webclient fails to start up because it looks for https://domain/mopidy/mopidy.min.js while it should load https://domain/mopidy/mopidy/mopidy.min.js.

The fix is to load the js file through the relative path ../mopidy/mopidy.min.js instead of /mopidy/mopidy.min.js. I’ll prepare a PR in a second.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 17 (7 by maintainers)

Most upvoted comments

Found solution for apache2.4 Just make you sure, that you have proxy_wstunnel installed (a2enmod proxy_wstunnel)

<VirtualHost *:8080>

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
<Proxy *>
Allow from all
</Proxy>
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

ProxyRequests On
ProxyPass /musicbox_webclient/ http://localhost:6680/musicbox_webclient/
ProxyPassReverse /musicbox_webclient/ http://localhost:6680/musicbox_webclient/

ProxyPass /mopidy/ ws://localhost:6680/mopidy/
ProxyPassReverse /mopidy/ ws://localhost:6680/mopidy/

ProxyPass /mopidy/ http://localhost:6680/mopidy/
ProxyPassReverse /mopidy/ http://localhost:6680/mopidy/

</VirtualHost>