location ~ /jupyter/ {
    proxy_pass            http://notebook;
    proxy_set_header      Host $host;
    proxy_http_version    1.1;
    proxy_set_header      Upgrade $http_upgrade;
    proxy_set_header      Connection "upgrade";
    proxy_set_header      Origin "";
}

location ~ /jupyter/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 ~ /jupyter/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;
}
