I deployed a jupyter notebook
on the intranet machine A
using docker
, and its ip
is 10.11. 11.10
, the service port number is 8888
, and machine B
can access its 80 through the department’s second-level domain name (such as
child.testgroup.org)
Contents of the port.
Now I am doing a reverse proxy on nginx
of B
machine, and I hope to access jupyter notebook through
child.testgroup.org/notebook
. My configuration is as follows:
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";
}
But when accessing through child.testgroup.org/notebook
, an error of url
always occurs, as shown below:
##jupyter notebook will jump to the directory
/tree,
gitlab-ce will jump to
/sign_in, originally Hope
url is
child.testgroup.org/notebook/tree and
child.testgroup.org/notebook/sign_in, but when jumping, include the subsequent
ajax requests will not automatically add the
/notebook/ paragraph, and become
child.testgroup.org/tree and
child.testgroup.org /sign_in.
nginx configuration or whether other elements are needed.
巴扎黑2017-06-06 09:56:28
Add /notebook/ after proxy_pass, and if you want child.testgroup.org/notebook to be accessible, the location should be /notebook
location /notebook {
proxy_pass http://10.11.11.10:8888/notebook/;
proxy_redirect off;
...
}