-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCaddyfile
27 lines (26 loc) · 1008 Bytes
/
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
localhost {
handle_path /api/* {
rewrite * /api{path}
reverse_proxy https://whale-app-nm9uv.ondigitalocean.app {
header_up Host {upstream_hostport}
header_down Access-Control-Allow-Origin *
header_down Access-Control-Allow-Methods "GET, POST, OPTIONS, PUT, DELETE"
header_down Access-Control-Allow-Headers "Content-Type, Authorization"
header_down Access-Control-Allow-Credentials true
}
@options {
method OPTIONS
}
handle @options {
respond "" 204
header Access-Control-Allow-Origin *
header Access-Control-Allow-Methods "GET, POST, OPTIONS, PUT, DELETE"
header Access-Control-Allow-Headers "Content-Type, Authorization"
header Access-Control-Allow-Credentials true
}
}
# passthrough to frontend
handle {
reverse_proxy http://localhost:5173
}
}