Skip to content

Instantly share code, notes, and snippets.

@M3nin0
Created May 27, 2021 16:47
Show Gist options
  • Save M3nin0/1ffd36bdebb4f3465683d1e71313347b to your computer and use it in GitHub Desktop.
Save M3nin0/1ffd36bdebb4f3465683d1e71313347b to your computer and use it in GitHub Desktop.
location /my-jupyter/ {
proxy_pass http://my-jupyter:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 90;
add_header Access-Control-Allow-Origin *;
}
location ~* /my-jupyter/.+\/.+\/(api/kernels/[^/]+/(channels|iopub|shell|stdin)|terminals/websocket)/? {
proxy_pass http://my-jupyter:8000;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# 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