summaryrefslogtreecommitdiff
path: root/caddy/Caddyfile
diff options
context:
space:
mode:
authorseth <[email protected]>2023-02-08 02:31:06 -0500
committerseth <[email protected]>2023-02-08 02:31:06 -0500
commit5e4b6ebb8c9e6adaf1ab12802beb82c59c88dcab (patch)
tree4a1ddb00d04dc94612cf01c4ffc2eb6443fa6db4 /caddy/Caddyfile
parent7a6d77e94da09fb1a4e32ebd90e794049f0c737d (diff)
switch to caddy + centralize services
Diffstat (limited to 'caddy/Caddyfile')
-rw-r--r--caddy/Caddyfile42
1 files changed, 42 insertions, 0 deletions
diff --git a/caddy/Caddyfile b/caddy/Caddyfile
new file mode 100644
index 0000000..1bb889f
--- /dev/null
+++ b/caddy/Caddyfile
@@ -0,0 +1,42 @@
+{
+ log {
+ output stdout
+ format console
+ }
+}
+
+(strip-www) {
+ redir https://{args.0}{uri}
+}
+
+(common_domain) {
+ encode gzip
+ handle {
+ try_files {path} {path}/ =404
+ }
+}
+
+(no_embeds) {
+ header /{args.0} X-Frame-Options DENY
+}
+
+(container_proxy) {
+ handle_path /{args.0}/* {
+ reverse_proxy {args.1}
+ }
+}
+
+www.{$DOMAIN:localhost} {
+ import strip-www {$DOMAIN:localhost}
+}
+
+{$DOMAIN:localhost} {
+ root * {$CADDY_ROOT:/var/www}
+ import common_domain
+
+ file_server browse
+
+ import no_embeds lul.html
+ import container_proxy api {$API_HOST:api}:80
+}