国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術文章
文章詳情頁

http - nginx 反向代理 url 錯誤

瀏覽:105日期:2024-06-15 18:21:38

問題描述

我在內網的機器A上用docker部署了一個jupyter notebook,其ip為10.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錯誤,如下圖:http - nginx 反向代理 url 錯誤

jupyter notebook會跳轉到/tree這個目錄下,gitlab-ce會跳轉到/sign_in,本來希望url是child.testgroup.org/notebook/tree及child.testgroup.org/notebook/sign_in,但跳轉時,包括后續的ajax請求都不會自動加上/notebook/這一段,變成了child.testgroup.org/tree及child.testgroup.org/sign_in。

請大家幫忙看看怎么辦,是修改nginx配置還是需要其它的要素。

問題解答

回答1:

proxy_pass后面加上/notebook/,并且希望child.testgroup.org/notebook可訪問,那location應該為/notebook

location /notebook {proxy_pass http://10.11.11.10:8888/notebook/;proxy_redirect off;...}

相關文章:
主站蜘蛛池模板: 北辰区| 白城市| 喀喇| 岳阳县| 波密县| 泰来县| 克拉玛依市| 富锦市| 巩留县| 永济市| 奉节县| 织金县| 萨迦县| 吴忠市| 正镶白旗| 九江县| 江西省| 诏安县| 凤山市| 广南县| 清涧县| 垦利县| 阳东县| 凤山市| 汶上县| 巴楚县| 邢台县| 盘山县| 台东市| 巨野县| 玉门市| 浠水县| 青阳县| 西畴县| 巴彦淖尔市| 宣威市| 浦城县| 大城县| 彰化县| 汕头市| 美姑县|