Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save christopher-baek/39e6c432e212ca7a67ffe015fe869664 to your computer and use it in GitHub Desktop.
Save christopher-baek/39e6c432e212ca7a67ffe015fe869664 to your computer and use it in GitHub Desktop.
Jupyter Notebook Behind NGINX Proxy Configuration Example
# Jupyter configuration:
c.NotebookApp.base_url = '/notebooks/'
c.NotebookApp.ip = 'localhost'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888
c.NotebookApp.tornado_settings = {'static_url_prefix':'/notebooks/static/'}
...
location /notebooks/ {
proxy_pass http://127.0.0.1:8888;
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_redirect off;
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_set_header Origin "";
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment