The jupyterhub docs demonstrate how to configure nginx as a reverse proxy. One of the configuration statements is proxy_set_header X-Forwarded-Proto $scheme;
and I’m using it in a local nginx/hub configuration with jupyterhub 1.1. Unfortunately I’ve found that use of X-Forwarded-Proto causes unexpected behavior when using jupyter-rsession-proxy and rstudio. This may be a bug in one of those projects, but when I eliminated the X-Forwarded-Proto statement from my nginx config, the unexpected behavior went away and I didn’t spot any regressions when using the hub.
I’ve read about the header, and it seems logical why one may need to include it, but does it happen to still be necessary? My hub doesn’t seem worse off for not including it. Here are the proxy statements I am using:
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# https://github.com/jupyterhub/jupyterhub/issues/2284#issuecomment-527196161
proxy_set_header X-Scheme $scheme;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;