-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf.template
More file actions
36 lines (32 loc) · 1.08 KB
/
nginx.conf.template
File metadata and controls
36 lines (32 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
server {
listen 80;
# Serve Angular app
root /usr/share/nginx/html;
index index.html;
# Route other API requests to the backend
location /${PLATFORM_BACKEND_CONTEXT}/ {
proxy_pass http://${PLATFORM_BACKEND_SERVER};
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
# Route notebook traffic to Jupyter
location /${JUPYTER_CONTEXT}/ {
set $notebook_enabled "${NOTEBOOK_ENABLED}";
if ($notebook_enabled != "1") {
return 404;
}
set $jupyter_upstream "${JUPYTER_SERVER}";
proxy_pass http://$jupyter_upstream;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
# Fallback to index.html for Angular routing
location / {
try_files $uri /index.html;
}
}