Skip to content

Instantly share code, notes, and snippets.

@mathewcohle
Created January 23, 2017 15:46
Show Gist options
  • Select an option

  • Save mathewcohle/56d1570ab53b0950f8166ee21650f903 to your computer and use it in GitHub Desktop.

Select an option

Save mathewcohle/56d1570ab53b0950f8166ee21650f903 to your computer and use it in GitHub Desktop.
Nginx config file to set up jupyter notebook server behind it.
upstream notebook {
server localhost:8888;
}
server{
listen 80;
location / {
proxy_pass http://notebook;
proxy_set_header Host $host;
}
location ~ /api/kernels/ {
proxy_pass http://notebook;
proxy_set_header Host $host;
# websocket support
proxy_http_version 1.1;
proxy_set_header Upgrade "websocket";
proxy_set_header Connection "Upgrade";
proxy_read_timeout 86400;
}
location ~ /terminals/ {
proxy_pass http://notebook;
proxy_set_header Host $host;
# websocket support
proxy_http_version 1.1;
proxy_set_header Upgrade "websocket";
proxy_set_header Connection "Upgrade";
proxy_read_timeout 86400;
}
}
@mathewcohle
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment