添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
爽快的莲藕  ·  Following build on ...·  3 周前    · 
面冷心慈的啄木鸟  ·  GitHub - ...·  1 月前    · 
淡定的猴子  ·  remove method - Map ...·  5 月前    · 
潇洒的野马  ·  python or用法_千锋教育·  7 月前    · 
精彩文章免费看

jupyterhub搭建及配置

官方文档

https://jupyterhub.readthedocs.io/en/latest/reference/technical-overview.html
找一台linux服务器专门用于jupyterhub的搭建
用root账号启动jupyterhub,jupyterhub的账号系统直接与linux的账号相关

为了实现跨域跳转登录
jupyterhub_config.py配置文件内容增加:

# 登录后默认看到的页面
c.Spawner.default_url = '/tree/'
# 跳转路由
c.JupyterHub.base_url = u'/jupyter/'
c.JupyterHub.bind_url = 'http://127.0.0.1:8000/jupyter/'
# 允许跨域,模拟登陆生成cookie的时候会用到
c.Spawner.args = ['--NotebookApp.allow_origin=*']
c.JupyterHub.tornado_settings = {
    'headers': {
        'Access-Control-Allow-Origin': '*',

nginx代理配置

location /jupyter/ {
            # 跨域配置
            add_header Access-Control-Allow-Origin *;
            add_header Access-Control-Allow-Methods 'GET, POST, PUT, DELETE, OPTIONS';
            add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
            # jupyter地址
            proxy_pass http://127.0.0.1:8000;
            proxy_set_header Host $host;
            proxy_set_header X-Real-Scheme $scheme;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            # ws配置
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_read_timeout 120s;
            proxy_next_upstream error;
jupyter中使用matplotlib

调中文字体:https://blog.csdn.net/qq_41770424/article/details/115708626

最后编辑于:2023-04-27 17:05