Skip to content

Instantly share code, notes, and snippets.

@cboettig
Created December 31, 2015 18:41
Show Gist options
  • Save cboettig/18e1becaa8974139adff to your computer and use it in GitHub Desktop.
Save cboettig/18e1becaa8974139adff to your computer and use it in GitHub Desktop.
Caddyserver proxy for Jupyter
https://example.com {
proxy / jupyter:8888 {
proxy_header X-Real-IP {remote}
proxy_header Host {host}
}
proxy {{.PathMatches "~* /(api/kernels/[^/]+/(channels|iopub|shell|stdin)|terminals/websocket)/?"}} jupyter:8888 {
proxy_header X-Real-IP {remote}
proxy_header Host {host}
websocket
}
}
jupyter:
image: jupyter/minimal-notebook
environment:
- PASSWORD=${PASSWORD}
caddy:
image: joshix/caddy
links:
- jupyter
volumes:
- .:/var/www/html
- $HOME/.caddy/:/.caddy
ports:
- 80:80
- 443:443
@naviat
Copy link

naviat commented May 24, 2019

@kebot what's about for rewrite expression?

@colinaaa
Copy link

@cboettig
Copy link
Author

Thanks @colinaaa!

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