gpt4 book ai didi

nginx - Jupyterhub 和 nginx 反向代理配置

转载 作者:行者123 更新时间:2023-12-03 23:17:59 24 4
gpt4 key购买 nike

我试图配置 jupyterhub 代理以将内容路由到 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;

}
}

最佳答案

我通过在 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'

关于nginx - Jupyterhub 和 nginx 反向代理配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45797565/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com