notandy / ympd

Standalone MPD Web GUI written in C, utilizing Websockets and Bootstrap/JS
http://www.ympd.org
GNU General Public License v2.0
517 stars 144 forks source link

nginx: auto-redirect to http://host/#/0 #181

Open laclaro opened 5 years ago

laclaro commented 5 years ago

Hi,

probably it is not an issue with ympd but rather with my webserver nginx (see https://github.com/notandy/ympd/issues/77). However, maybe someone has some clue here.

If I browse to https://host/ympd, ympd does not load entirely. Only if I click "Queue" or anything, the page completes loading. So, why does ympd not redirect to the correct site? Does it without reverse proxy as setup by me?

Any suggestion to add a redirect for https://host/ympd -> https://host/ympd/#

Current setup

    # ympd proxy settings for /ympd
    # https://github.com/notandy/ympd/issues/77
    location /ympd {
        rewrite            ^/ympd(.*)  /$1  break;
        proxy_redirect     http://ympd   /ympd/;
        proxy_set_header   Host $http_host;
        proxy_redirect     off;
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   X-Scheme $scheme;
        proxy_pass         http://ympd$uri;
        proxy_http_version 1.1;
        proxy_set_header   Upgrade $http_upgrade;
        proxy_set_header   Connection "upgrade";
    }

    location ~ ^/(css|assets|fonts|js|player.html) {
        proxy_pass         http://ympd;
        proxy_http_version 1.1;
        proxy_set_header   Upgrade $http_upgrade;
        proxy_set_header   Connection "upgrade";
    }

Best,

Henning