http - nginx 反向代理 url 错误
世界只因有你
世界只因有你 2017-06-06 09:54:28
0
1
985

我在内网的机器A上用docker部署了一个jupyter notebook,其ip10.11.11.10,服务端口号为8888,机器B可以通过部门二级域名(如child.testgroup.org)访问其80端口的内容。

现在我在,B机的nginx上做反向代理,希望通过child.testgroup.org/notebook来访问jupyter notebook。我的配置如下:

location /notebook/ {
                proxy_pass http://10.11.11.10:8888/;
                proxy_redirect 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_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
        }

但通过child.testgroup.org/notebook来访问时总是出现url错误,如下图:

jupyter notebook会跳转到/tree这个目录下,gitlab-ce会跳转到/sign_in,本来希望urlchild.testgroup.org/notebook/treechild.testgroup.org/notebook/sign_in,但跳转时,包括后续的ajax请求都不会自动加上/notebook/这一段,变成了child.testgroup.org/treechild.testgroup.org/sign_in

请大家帮忙看看怎么办,是修改nginx配置还是需要其它的要素。

世界只因有你
世界只因有你

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!