-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathCaddyfile
41 lines (38 loc) · 1.18 KB
/
Caddyfile
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
37
38
39
40
41
{
log {
output file /var/log/caddy/error.log {
level ERROR
}
output file /var/log/caddy/access.log {
level INFO
}
}
}
:80 {
# WebSocket 转发
handle /ws {
reverse_proxy http://127.0.0.1:8765
}
# API 请求转发
handle /api/* {
reverse_proxy http://127.0.0.1:5000
}
# 静态文件服务
handle {
root * /app/frontend/dist
try_files {path} /index.html
file_server
}
encode gzip {
match {
header Content-Type text/plain
header Content-Type text/css
header Content-Type application/json
header Content-Type application/javascript
header Content-Type text/xml
header Content-Type application/xml
header Content-Type application/xml+rss
header Content-Type text/javascript
}
}
}