-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCaddyfile
More file actions
55 lines (46 loc) · 1.76 KB
/
Caddyfile
File metadata and controls
55 lines (46 loc) · 1.76 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
bpsapi.rajtech.me {
root * /var/www/bpsapi.rajtech.me/
# Define routes for static backends
handle_path /three/* {
rewrite * {path}
reverse_proxy http://three.nodes.rajtech.me:5641
}
handle_path /oracleone/* {
rewrite * {path}
reverse_proxy http://oracleone.nodes.rajtech.me:5001
}
# Give preference to the local server for circular images
route /circular-image/* {
reverse_proxy http://three.nodes.rajtech.me:5641 http://oracleone.nodes.rajtech.me:5001 {
health_uri /
lb_try_duration 5s
lb_policy first
@error status 500 502 503
handle_response @error {
reverse_proxy * http://oracleone.nodes.rajtech.me:5001
}
}
}
# Give preference to the off-site server for the rest of the API
route /* {
file_server /docs*
reverse_proxy http://oracleone.nodes.rajtech.me:5001 http://three.nodes.rajtech.me:5641 {
health_uri /
lb_try_duration 5s
lb_policy first
@error status 500 502 503
handle_response @error {
reverse_proxy * http://three.nodes.rajtech.me:5641
}
}
}
redir /v1 /
# Redirect /v1/* to /* (legacy api url)
handle_path /v1/* {
rewrite * {path}
}
# For SSL
tls {
dns cloudflare {RAJ_CLOUDFLARE_API_TOKEN}
}
}