Mopidy Raspberry Pi and Nginx


I installed Mopidy on Raspberry Pi. I want to control it by web clients, on the same wifi network. I enabled the http extension. If I change the hostname parameter in the [http] part in the mopidy.conf file, I’m able to reach the Raspberry Pi by http://
But I would like to avoid the 6680 port ( lazyness ), so I installed nginx and configured it, like this link describes ( ).
When I try to reach the Raspberry pi over http://, it gives me 502 bad gateway error, and in the nginxe error.log it says “Connection refused 111”.

Do you know what is the right configuration ?

Thank you

I was looking at this ages ago (needs revisiting) and we were using this config

Haven’t tried this yet myself, but for simply redirecting port 80 to another local port there shouldn’t be any need to install an additional HTTP server:

100% agree with @tkem and that’s what we currently use in musicbox.

A reverse proxy can give you some extra features (and is one reason we will move to it) but for simplicity, ip tables is great.

Thank you for the quick answers. I did as you suggested and it’s all ok now! Great

Has anyone here in the forum tried to redirect an mopidy extension to an auth/login page
via nginx? The idea behind is to accept public access for mopidy-party,
and restricted access for mopidy-mobile.

My current (working) nginx config to shorten the path for mopidy-party:

server {
listen 80 default_server;
server_name _;

    location / {
            proxy_buffering off;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            rewrite /mopidy/(.*) /mopidy/$1 break;
            rewrite /(.*) /party/$1 break;
            proxy_redirect off;


Is there a way to add a locations block which could do this?

Thanks in advance.