-
Notifications
You must be signed in to change notification settings - Fork 0
/
Caddyfile
56 lines (49 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# global options
{
admin off # theres no need for the admin api in railway's environment
persist_config off # storage isn't persistent anyway
auto_https off # railway handles https for us, this could in some cases cause issues if left enabled
# runtime logs
log {
format json # set runtime log format to json mode
}
# server options
servers {
trusted_proxies static private_ranges 100.0.0.0/8 # trust railway's proxy
}
}
# site block, listens on the $PORT environment variable, automatically assigned by railway
:{$PORT} {
# access logs
log {
format json # set access log format to json mode
}
reverse_proxy /* {$WEB_ENDPOINT} {
header_up Host {upstream_hostport}
}
handle /god-mode/* {
reverse_proxy {$ADMIN_ENDPOINT} {
header_up Host {upstream_hostport}
}
}
handle /api/* {
reverse_proxy {$API_ENDPOINT} {
header_up Host {upstream_hostport}
}
}
handle /auth/* {
reverse_proxy {$API_ENDPOINT} {
header_up Host {upstream_hostport}
}
}
handle /spaces/* {
reverse_proxy {$SPACES_ENDPOINT} {
header_up Host {upstream_hostport}
}
}
handle /{$BUCKET_NAME}/* {
reverse_proxy {$BUCKET_ENDPOINT} {
header_up Host {upstream_hostport}
}
}
}