-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnginx.conf
More file actions
36 lines (32 loc) · 1.08 KB
/
Copy pathnginx.conf
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;
server_name localhost jupyterhub.csie.ncu.edu.tw; # 同時匹配本地及外部域名
# 設置根路徑,提供前端靜態文件
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html; # 支持 Vue 路由
}
# 代理 API 請求到後端服務
location /api/ {
proxy_pass http://gpu-service-be.gpu-service.svc.cluster.local:8080;
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;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
}
# 健康檢查端點
location /health {
access_log off;
return 200 'OK';
}
# 處理錯誤頁面
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}