回答
收藏
分享
举报
Nginx在子目录反向代理jupyter-lab的配置方法?
提问于2021-09-05 08:43

浏览 4.1k

文章标签

参考gotify的subpath配置

尝试Nginx在子目录反向代理jupyter-lab,失败显示 301 Moved Permanently

请问修改配置文件的哪里呢

我的配置是:

upstream jupyter {
server 127.0.0.1:9999;
}

server {
listen 80;
server_name _;

location /jupyter/ {
proxy_pass http://jupyter/;
rewrite ^ $1 permanent;
proxy_http_version 1.1;

# Ensuring it can use websockets
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto http;
proxy_redirect http:// $scheme://;

# The proxy must preserve the host because gotify verifies the host with the origin
# for WebSocket connections
proxy_set_header Host $http_host;

proxy_connect_timeout 7m;
proxy_send_timeout 7m;
proxy_read_timeout 7m;
}

已修改于2023-03-15 02:13



写下您的回答
发表回答
全部回答(1)

按点赞数排序

按时间排序

感觉应该是rewrite ^ $1 permanent;这个是301永久重定向,发生在rewrite阶段,先于content阶段的proxy_pass。

赞同

0

回复举报

回答于2021-09-06 12:27



回复罗剑锋
回复
提问者
鸾
这家伙很懒还未留下介绍~
0
文章
1
问答
0
粉丝
相关问答

accesskey为nginx第三方模块指令,需要安装nginx第三方模块ngx_http_accesskey_module。我下载的
https://github.com/Martchus/nginx-accesskey,测试通过,--add-module=/home/lq/work/nginx-accesskey(模块源码路径)必须指定,其他参数根据自己情况而定。
Ubuntu18.04编译参数如下:./configure --prefix=/opt/nginx --with-http_stub_status_module --with-http_ssl_module --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --add-module=/home/lq/work/tongmingzhiyun/openresty/lua-nginx-module-0.10.21 --add-module=/home/lq/work/tongmingzhiyun/openresty/ngx_devel_kit-0.3.1 --add-module=/home/lq/work/nginx-accesskey

点赞 0
浏览 6.2k

三角传输与NG无关,NG处理的是四层及以上协议,而三角传输主要是二层、三层协议上做文章。

点赞 0
浏览 3.8k