jupyter 配置
配置文件在 /{user.dir}/.jupyter/jupyter_notebook_config.py
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.password = u'sha1:2b64ebc42383:6f0cd4eb5ea9ede24b76e3baebe91aa1d051f62c'
c.NotebookApp.port = 8888
c.NotebookApp.iopub_data_rate_limit=1.0e10
#配置 jupyter 的路径
c.NotebookApp.base_url = '/nb/'
如果没有此配置文件,请使用 jupyter notebook --generate-config产生
c.NotebookApp.password请使用 jupyter notebook password生成
nginx 配置
jupyter 使用了 websocket 协议,所以需要配置支持 websocket。
在nginx的配置文件conf/nginx.conf文件中的http.server中配置代理如下:
location /nb {
proxy_pass http://172.25.101.28:10088/nb;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-Scheme $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# WebSocket support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 120s;
proxy_next_upstream error;
proxy_redirect off;
proxy_buffering off;
}