Skip to content

Instantly share code, notes, and snippets.

@kwsp
Created March 23, 2021 13:57
Show Gist options
  • Select an option

  • Save kwsp/34ad3f5ede80fded2740dbf45ffd87a7 to your computer and use it in GitHub Desktop.

Select an option

Save kwsp/34ad3f5ede80fded2740dbf45ffd87a7 to your computer and use it in GitHub Desktop.
Nginx jupyter lab proxy setup. Use CertBot to get SSL encryption.
upstream nb {
server 10.19.0.10:1234;
}
server {
server_name example.com;
location / {
proxy_pass http://nb;
proxy_set_header Host $host;
}
location ~ (/api/kernels/|/terminals/) {
proxy_pass http://nb;
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;
}
client_max_body_size 50M;
error_log /var/log/nginx/error.log;
listen 80;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment