Skip to content

Instantly share code, notes, and snippets.

@walice
Created March 13, 2025 02:57
Show Gist options
  • Select an option

  • Save walice/e2ad86a022cc4d7a435abcbd9e244b51 to your computer and use it in GitHub Desktop.

Select an option

Save walice/e2ad86a022cc4d7a435abcbd9e244b51 to your computer and use it in GitHub Desktop.
Contents of the Nginx configuration file for the multi-user JupyterHub. This file should be placed in `/etc/nginx/sites-available/training`.
server {
server_name <yourdomain.com>;
listen 80;
# RStudio Proxy
location /rstudio/ {
proxy_pass http://127.0.0.1:8787/;
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 Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
# JupyterHub Proxy
location /jupyter/ {
proxy_pass http://127.0.0.1:8000/jupyter/;
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 Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
# Static Assets for JupyterHub
location /jupyter/hub/static/ {
proxy_pass http://127.0.0.1:8000/jupyter/hub/static/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment