Answer the question
In order to leave comments, you need to log in
How to replace server:8888 with server/jupyter using nginx?
Good day.
Jupyter is running on port 8888 on the home server.
Also back-end Apache web server on port 8080 and Nginx proxying it on port 80.
How can I redirect Nginx to Jupyter so that the Jupyter link is server/jupyter instead of server:8888 ?
Tried to do it, but gives 404 error.
Here is the part of my nginx.conf config file with redirects:
upstream ipy {
server 127.0.0.1:8888;
}
server {
listen 80;
server_name localhost;
# Apache
location / {
proxy_pass http://127.0.0.1:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_connect_timeout 120;
proxy_send_timeout 120;
proxy_read_timeout 180;
}
# Jupyter
location /jupyter {
proxy_pass http://ipy;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_connect_timeout 120;
proxy_send_timeout 120;
proxy_read_timeout 180;
proxy_set_header Origin "";
}
Answer the question
In order to leave comments, you need to log in
upstream ipy {
server 127.0.0.1:1488;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question