-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCaddyfile
68 lines (59 loc) · 1.58 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
:80 {
# Handle admin static files first
@adminStatic path /admin/*.js /admin/*.css /admin/*.png /admin/*.jpg /admin/*.svg /admin/*.json /admin/*chunk*.js /admin/*.async.js /admin/p__*.js
handle @adminStatic {
uri strip_prefix /admin
root * /app/admin
header Content-Type {header.content-type}
file_server
}
# Then handle general admin routes
@admin path /admin*
handle @admin {
uri strip_prefix /admin
root * /app/admin
try_files {path} {path}/ /index.html
file_server
}
# Handle direct Waline endpoints
@comment path /comment* /token* /oauth* /user* /ui* /db*
handle @comment {
reverse_proxy 127.0.0.1:8360
}
# Handle Waline endpoints with /api/ prefix
@apiWaline path /api/comment* /api/user* /api/token* /api/oauth* /api/ui* /api/db* /api/article*
handle @apiWaline {
reverse_proxy 127.0.0.1:8360
}
# Handle regular API endpoints
@api path /api/*
handle @api {
reverse_proxy 127.0.0.1:3000
}
# Static assets, RSS feeds, etc.
@favicon path /favicon*
handle @favicon {
uri replace /favicon /static/img/favicon
reverse_proxy 127.0.0.1:3000
}
@feeds path /feed.json /feed.xml /atom.xml /sitemap.xml
handle @feeds {
uri replace /feed.json /rss/feed.json
uri replace /feed.xml /rss/feed.xml
uri replace /atom.xml /rss/atom.xml
uri replace /sitemap.xml /sitemap/sitemap.xml
reverse_proxy 127.0.0.1:3000
}
@static path /static/* /custom/* /c/* /rss/* /swagger*
handle @static {
reverse_proxy 127.0.0.1:3000
}
# Default handler for website
handle {
reverse_proxy 127.0.0.1:3001
}
encode gzip zstd
log {
output file /var/log/caddy.log
}
}