/ / Jupyterhubおよびnginxリバースプロキシ構成-nginx、jupyterhub

Jupyterhubとnginxリバースプロキシ設定 - nginx、jupyterhub

私はに行くコンテンツをルーティングするようにju​​pyterhubプロキシを設定しようとしていました my-host-ip/notebook しかし、私は解決策を理解することができません。

次のNginx構成を使用しています。

server {
listen 80;
server_name  localhost;

location /notebook {
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;

}
}

回答:

回答№1は2

これを修正するには、jupyterhub構成ファイルで次のオプションを使用します。

# Force the proxy to only listen to connections to 127.0.0.1
c.JupyterHub.ip = "127.0.0.1"
c.JupyterHub.base_url = u"/notebook"