I’ve just been playing with this myself and saw you post without an answer, instead of X-Forwarded-Scheme, try using:
proxy_set_header X-Forwarded-Proto $scheme;
I’ve made a PR to address the documentation, which also suggests to turn off proxy buffering.
This may also fix some issues people are having with HABdroid when using a reverse proxy and https and authentication.