自学内容网 自学内容网

如何映射Jupyter服务到Nginx的/Jupyter下

起因:端口不够用,使用路径映射代理服务,如:用/jupyter代表jupyter服务。

1、Jupyter启动:需要增加/jupyter设置

jupyter-lab --ip=0.0.0.0 --port=8888 --no-browser --allow-root --NotebookApp.token='mytoken' --NotebookApp.base_url='/jupyter'

2、Nginx配置:

#Jupyter服务配置
upstream jupyter {
    server 172.17.0.2:6006; #Jupyter服务地址
}


#代理路径映射配置
location /jupyter {
        proxy_http_version 1.1;
        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-Host $server_name;
        proxy_set_header   X-Forwarded-Proto https;
        proxy_set_header   Upgrade $http_upgrade;
        proxy_set_header   Connection "upgrade";
        proxy_read_timeout 86400;
        proxy_pass http://jupyter;
    }


原文地址:https://blog.csdn.net/wxl781227/article/details/143765544

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!