File tree 3 files changed +36
-2
lines changed
3 files changed +36
-2
lines changed Original file line number Diff line number Diff line change 1
- {$CADDY_HOST} {
1
+ www . {$CADDY_HOST} {
2
2
tls {$CADDY_TLS_EMAIL}
3
3
gzip
4
4
root /var/www/nerd_herder
28
28
without /proxy
29
29
}
30
30
}
31
+
32
+ {$CADDY_HOST} {
33
+ redir https://www. {$CADDY_HOST}{uri}
34
+ }
Original file line number Diff line number Diff line change
1
+ {$CADDY_HOST} {
2
+ tls {$CADDY_TLS_EMAIL}
3
+ gzip
4
+ root /var/www/nerd_herder
5
+
6
+ redir 302 {
7
+ # Caddy is dumb and has no way of redirecting only the index without this if statment.
8
+ if {path} is /
9
+ / /app/
10
+ }
11
+
12
+ rewrite /app {
13
+ to {path} {path}/ /
14
+ }
15
+
16
+ rewrite /favicon {
17
+ to {path}
18
+ }
19
+
20
+ # First attempt to load the file (via {path}), if that fails re-write to the proxy URL
21
+ rewrite {
22
+ to {path} /proxy/{uri}
23
+ }
24
+
25
+ # Proxy to nerd_herder service via /proxy, but drop the /proxy prefix
26
+ proxy /proxy nerd_herder:8080 {
27
+ transparent
28
+ without /proxy
29
+ }
30
+ }
Original file line number Diff line number Diff line change @@ -61,6 +61,6 @@ services:
61
61
- nerd_herder
62
62
volumes :
63
63
- ' ./.docker-data/caddy:/root/.caddy'
64
- - ' ./Caddyfile:/etc/Caddyfile'
64
+ - ' ./Caddyfile.staging :/etc/Caddyfile'
65
65
ports :
66
66
- ' 8080:8080'
You can’t perform that action at this time.
0 commit comments