-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCaddyfile
More file actions
34 lines (28 loc) · 710 Bytes
/
Copy pathCaddyfile
File metadata and controls
34 lines (28 loc) · 710 Bytes
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
www.{$CADDY_HOST} {
tls {$CADDY_TLS_EMAIL}
gzip
root /var/www/nerd_herder
redir 302 {
# Caddy is dumb and has no way of redirecting only the index without this if statment.
if {path} is /
/ /app/
}
rewrite /app {
to {path} {path}/ /
}
rewrite /favicon {
to {path}
}
# First attempt to load the file (via {path}), if that fails re-write to the proxy URL
rewrite {
to {path} /proxy/{uri}
}
# Proxy to nerd_herder service via /proxy, but drop the /proxy prefix
proxy /proxy nerd_herder:8080 {
transparent
without /proxy
}
}
{$CADDY_HOST} {
redir https://www.{$CADDY_HOST}{uri}
}