修改配置文件

配置文件位置:
vi /home/jovyan/.jupyter/jupyter_notebook_config.py
c.LabApp.disable_check_xsrf = True
c.NotebookApp.disable_check_xsrf = True
c.NotebookApp.tornado_settings = {'headers': { 'Content-Security-Policy': "frame-ancestors * 'self'" } }
c.NotebookApp.allow_origin = '*'
c.NotebookApp.open_browser = False
#c.NotebookApp.allow_remote_access=True       
c.NotebookApp.allow_remote_access = True

c.NotebookApp.token = ''
c.NotebookApp.ip = '0.0.0.0'
#更改默认目录
c.NotebookApp.notebook_dir = '/home/jovyan/'
c.NotebookApp.allow_root = True



vi /etc/jupyter/jupyter_server_config.py
在c.ServerApp.open_browser = False后添加
c.ServerApp.trust_xheaders = True
c.ServerApp.disable_check_xsrf = True
c.ServerApp.disable_check_xsrf = True
c.ServerApp.tornado_settings = {'headers': { 
    'Content-Security-Policy': "frame-ancestors * 'self' "
 } }
c.ServerApp.token = ''
c.ServerApp.allow_origin = '*'
c.ServerApp.allow_remote_access = True
c.ServerApp.ip = '0.0.0.0'
c.ServerApp.notebook_dir = '/home/jovyan/'
c.ServerApp.allow_root = True
#https
#c.ServerApp.certfile = '/ssl/server.pem'
#c.ServerApp.keyfile = '/ssl/server.key'

iframe修改

<iframe 
sandbox="allow-same-origin allow-popups allow-scripts allow-forms allow-top-navigation"
src="https://xxxx.com:8888/?token=1c0a9793"
referrerpolicy="no-referrer"></iframe>

#打开默认文件 
/notebooks/worker/demo.ipynb
#显示列表
#不打开文件默认显示列表