[IPython-dev] IPython notebook+nginx proxy+ssl+websockets

Kyle Kelley rgbkrk@gmail....
Sun Aug 25 12:17:25 CDT 2013


Interesting. I'm actually installing nginx using the nginx cookbook (
https://github.com/opscode-cookbooks/nginx). The version on the box is
rather old, and apparently ignoring my config.

vagrant@ipynb-cookbook-berkshelf:~$ nginx -v
nginx version: nginx/1.1.19

I'll definitely get a newer version installed pronto! Thanks Min!

-- Kyle



On Sun, Aug 25, 2013 at 12:00 PM, MinRK <benjaminrk@gmail.com> wrote:

> nginx support for websocket proxying is a relatively recent addition
> ([docs](http://nginx.org/en/docs/http/websocket.html) suggests 1.3.13.
>  Is it possible your version doesn't have this support?
>
> -MinRK
>
>
> On Sat, Aug 24, 2013 at 12:45 AM, Kyle Kelley <rgbkrk@gmail.com> wrote:
>
>> Hey all,
>>
>> Has anyone gotten nginx proxying to work when using ssl? I started off
>> with MinRK's nginx config (
>> https://twitter.com/minrk/status/329376092420993024), adding on to it
>> like so:
>>
>> server {
>>     listen 80;
>>     rewrite        ^ https://$host$request_uri? permanent;
>> }
>>
>> server {
>>     listen 443;
>>     ssl on;
>>     ssl_certificate /etc/nginx/ssl/cert.pem;
>>     ssl_certificate_key /etc/nginx/ssl/cert.key%>;
>>
>>     error_log /var/log/nginx/error.log;
>>
>>     location ^~ /static/ {
>>         alias
>> /home/ipynb/ipyvirt/lib/python2.7/site-packages/IPython/html/static/;
>>     }
>>
>>     location / {
>>       proxy_pass http://localhost:9999;
>>
>>       #proxy_set_header X-Real-IP $remote_addr;
>>       #proxy_set_header Host $http_host;
>>       #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
>>
>>       #proxy_set_header X-NginX-Proxy true;
>>
>>       # WebSocket support
>>       proxy_http_version 1.1;
>>       proxy_set_header Upgrade $http_upgrade;
>>       proxy_set_header Connection "upgrade";
>>       proxy_read_timeout 86400;
>>
>>    }
>> }
>>
>> Most of the proxying works just fine, but websockets fail. I could host
>> this using the certfile and keyfile setting in IPython (and not use nginx),
>> but was hoping to proxy from some high port by a non-privileged user to
>> port 443 (with a redirect from 80).
>>
>> -- Kyle
>>
>>
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev@scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>
>>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-dev/attachments/20130825/ee23e072/attachment.html 


More information about the IPython-dev mailing list