add nginx but notebook show connecting’

This commit is contained in:
2024-01-15 09:31:31 +08:00
parent 207781bed9
commit d04a3d2d16
2 changed files with 37 additions and 0 deletions

View File

@@ -35,6 +35,17 @@ services:
DOCKER_NOTEBOOK_IMAGE: hotwa/notebook:latest DOCKER_NOTEBOOK_IMAGE: hotwa/notebook:latest
# Notebook directory inside user image # Notebook directory inside user image
DOCKER_NOTEBOOK_DIR: /home/jovyan/work DOCKER_NOTEBOOK_DIR: /home/jovyan/work
# nginx:
# image: nginx:latest
# volumes:
# - ./nginx.conf:/etc/nginx/nginx.conf:ro
# ports:
# - "18188:80"
# depends_on:
# - hub
# networks:
# - jupyterhub-network
volumes: volumes:
jupyterhub-data: jupyterhub-data:

26
nginx.conf Normal file
View File

@@ -0,0 +1,26 @@
worker_processes 1;
events {
worker_connections 1024;
}
http {
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
location / {
proxy_pass http://hub:8000;
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_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}
}