Created
November 26, 2015 04:45
-
-
Save jdfreder/ae1382229153f21aa4f6 to your computer and use it in GitHub Desktop.
Simple nginx HTTP reverse proxy for JupyterHub on OSX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker_processes 1; | |
events { | |
worker_connections 768; | |
} | |
http { | |
include mime.types; | |
default_type application/octet-stream; | |
server { | |
listen 8080; | |
server_name localhost; | |
location / { | |
proxy_pass http://localhost:8000; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header Host $http_host; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
} | |
location ~* /(user[-/][a-zA-Z0-9]*)/(api/kernels/[^/]+/(channels|iopub|shell|stdin)|terminals/websocket)/? { | |
proxy_pass http://localhost:8000; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header Host $http_host; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
# WebSocket support | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
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
do you have idea, howto "not to have" jupyter hub in location / ? i have other web apps in nginx, and i want to have jupyterhub under /jupyterhub ...