http – Nginx-Reverse-Proxy-URL-Fehler
世界只因有你
世界只因有你 2017-06-06 09:54:28
0
1
1164

Inhalt des A上用docker部署了一个jupyter notebook,其ip10.11.11.10,服务端口号为8888,机器B可以通过部门二级域名(如child.testgroup.org)访问其80Ports meiner Maschine im Intranet.

Jetzt bin ich, B机的nginx上做反向代理,希望通过child.testgroup.org/notebook来访问jupyter notebook. Meine Konfiguration ist wie folgt:

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";
        }

Aber child.testgroup.org/notebook来访问时总是出现url Fehler bestanden, wie unten gezeigt:

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.

Bitte helfen Sie mir herauszufinden, was zu tun ist, ob die nginxKonfiguration geändert werden muss oder ob andere Elemente benötigt werden.

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

Antworte allen(1)
巴扎黑

proxy_pass后面加上/notebook/,并且希望child.testgroup.org/notebook可访问,那location应该为/notebook

location /notebook {
                proxy_pass http://10.11.11.10:8888/notebook/;
                proxy_redirect off;
                ...
        }
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!