yuvipanda / jupyterhub-nginx-chp

configurable-http-proxy for use with JupyterHub written in nginx + lua
BSD 3-Clause "New" or "Revised" License
12 stars 5 forks source link

Do not error if public_ip == '' #5

Closed ryanlovett closed 8 years ago

ryanlovett commented 8 years ago

Despite the traitlet default of 0.0.0.0, if I don't append --NCHPApp.public_ip=0.0.0.0 to c.JupyterHub.proxy_cmd, the nginx config will have listen :<myport> ssl; which will cause nginx to error with

no host in ":<myport>" of the "listen" directive in /tmp/...

I can workaround this with the patch so that the listen line becomes listen <myport> ssl; which is fine in this instance. The real problem is that public_ip is getting overridden I guess, but I'm not sure how.

yuvipanda commented 8 years ago

I think it's because if jupyterhub is starting it, and it sets ip to ''. I've pushed a PR to fix it at https://github.com/jupyterhub/jupyterhub/pull/740

yuvipanda commented 8 years ago

We can also work around this in nchp, but should put it in app.py rather than the jinja template.

yuvipanda commented 8 years ago

Intermediate workaround is to set:

c.JupyterHub.ip = '0.0.0.0'

in your jupyterhub_config.py file

yuvipanda commented 8 years ago

@ryanlovett can you try https://github.com/yuvipanda/jupyterhub-nginx-chp/pull/8

ryanlovett commented 8 years ago

The patch worked! (modulo a small syntax issue) The host is no longer empty.