- First, you need install jupyter notebook using
pip install jupyter
- Second, you need run notebook on the work dir using
jupyter notebook --no-browser --port=9998 --NotebookApp.base_url=/notebook
.- this make you notebook run on port 9998 with base url '/notebook', you need this base url for nginx dispatching
- Third, config you nginx config, and test is with
sudo nginx -t -c /etc/nginx/nginx.conf
, if ok reload nginx withsudo nginx -s reload -c /etc/nginx/nginx.conf
location /notebook/ {
proxy_pass http://localhost:9998;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;