@TedZhou
2024-06-14T03:57:50.000000Z
字数 1206
阅读 470
nginx uwsgi SCRIPT_NAME fixpathinfo
# nginx 配置location ~ ^/prefix/ {include uwsgi_params;uwsgi_param SCRIPT_NAME /prefix;#Pass the URL prefix to uWSGI so the "fixpathinfo:" route-rule can strip it outuwsgi_pass 127.0.0.1:6666;}
# uwsgi 配置[uwsgi]socket = 127.0.0.1:6666route-run = fixpathinfo:wsgi = sample:app...# 不依赖配置的等价命令行uwsgi --socket 127.0.0.1:6666 --route-run fixpathinfo: --master -p 4 -w sample:app --pidfile sample.pid --daemonize2 ./sample.log
#生成配置文件,打开编辑之jupyter notebook --generate-configvim ~/.jupyter/jupyter_notebook_config.py
# Configuration file for notebook.c = get_config() #noqac.ServerApp.ip = '127.0.0.1'c.ServerApp.port = 5000c.ServerApp.root_dir = '/pathto.ipynb'#c.NotebookApp.notebook_dir = '/pathto.ipynb'c.NotebookApp.base_url = '/notebook'c.NotebookApp.open_browser = False#c.NotebookApp.allow_root = True
# nginx 配置location ~ /notebook/ {proxy_redirect off;proxy_buffering off;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_pass http://127.0.0.1:5000;proxy_http_version 1.1;#websocketproxy_set_header Upgrade $http_upgrade;proxy_set_header Connection "upgrade";proxy_connect_timeout 30s;proxy_read_timeout 3600s;proxy_send_timeout 90s;}
