Skip to content

Instantly share code, notes, and snippets.

@mathewcohle
Created January 23, 2017 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mathewcohle/56d1570ab53b0950f8166ee21650f903 to your computer and use it in GitHub Desktop.
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;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment