Nginx reverser proxy error in configuration template

Hi: I have been following the steps at https://jupyterhub.readthedocs.io/en/stable/installation-guide-hard.html regarding the reverse proxy configuration using nginx. The configuration that is shown at that URL is:
location /jupyter/ {
# NOTE important to also set base url of jupyterhub to /jupyter in its config
proxy_pass http://127.0.0.1:8000;

proxy_redirect   off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

# websocket headers
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;

}
If you try this and check it by means of “nginx -t” you’ll see an error regarding “proxy_set_header Connection $connection_upgrade;” indicating that $connection_upgrade can not be found.

I have seen that in the following link https://www.nginx.com/blog/websocket-nginx/ you can find the right way to declare that sentence as mentioned in https://github.com/jupyterhub/jupyterhub/issues/781 by @willingc.

I think that this should be amended in the https://jupyterhub.readthedocs.io/en/stable/installation-guide-hard.html documentation page.

Best regards,

Jose

Hi, this is the reverse proxy documentation that I know and it has a full working example of nginx configuration. Mabe Install JupyterHub and JupyterLab from the ground up should reference to it for nginx configuration part.

Hi: Thank you @bitnik. Anyway, if you follow the instructions at https://github.com/jupyterhub/jupyterhub/issues/781 by @willingc it also works.

Regards,