2.11.0 nginx reverse proxy: .dashboard keeps redirecting 307

I'm facing an issue with the version 2.11.0 when using it on my server with nginx as a reverse proxy: the /.dashboard doesn't work, it keeps redirecting to itself with a 307 HTTP code.

Locally on my laptop I don't see this issue when testing directly using localhost.

I discovered SilverBullet pretty recently and I had been evaluating it with the version 2.10.0 on my server. I hadn't face any issue there with nginx with the same basic config I have now

    location / {
        proxy_pass       http://localhost:3000;
        proxy_set_header Host $host;
    }

So this seems like a regression from the newer version.

Any idea where this problem might come from, something wrong with SilverBullet or maybe I need to add now some more config to the proxy?

The proxy needs to forward the original request scheme. In 2.11, /.dashboard enforces the configured primary origin. If that URL is HTTPS but SilverBullet receives the proxied request without X-Forwarded-Proto: https, it redirects to the HTTPS primary URL.

Add this to the configuration :

 location / {
     proxy_pass http://localhost:3000;
     proxy_set_header Host $http_host;
     proxy_set_header X-Forwarded-Proto $scheme;
 }

That was it!

Thanks a lot for the explanation and the very quick answer.