summaryrefslogtreecommitdiff
path: root/caddy/Caddyfile
blob: ab7d955bb5ad87830452ae36567b1c4e7966228a (plain)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
{
    order forward_proxy before redir
}

(noindex) {
    header Referrer-Policy "no-referrer"
    header X-Robots-Tag "noindex, nofollow"
}

(crawler_bypass) {
    @crawler_bypass header X-Crawler-Access "f9a3c1e847b2d056"
    header @crawler_bypass -X-Robots-Tag
}

golive.yyamashita.com {
    import noindex
    import crawler_bypass
    reverse_proxy tokyo-app:3000
}

whoisband.yyamashita.com {
    import noindex
    import crawler_bypass
    reverse_proxy whois-app:3000
}

code.yyamashita.com {
    import noindex
    reverse_proxy 172.19.0.1:8080
}

git.yyamashita.com {
    import noindex
    reverse_proxy cgit:80
}

hetzner-admin.yyamashita.com {
    import noindex
    reverse_proxy hetzner-admin:5000
}

blog.yyamashita.com {
    import noindex
    reverse_proxy microblog-app:3000
}

todo.yyamashita.com {
    import noindex
    reverse_proxy todo-app:3000
}

studio.yyamashita.com {
    import noindex
    # パスワードの平文はサーバーの /root/studio-basic-auth.txt(root のみ読める)
    # /healthz は status の死活監視用に認証なしで通す
    @protected not path /healthz
    basic_auth @protected {
        studio $2a$14$SIhdKTJ7lmZe/lYM2AP4Su0W4T1n4w5qLY6BBT4HDlpy/kYaVrR0C
    }
    reverse_proxy studio-app:8000
}

status.yyamashita.com {
    import noindex
    reverse_proxy status-app:8080
}

ntfy.yyamashita.com {
    import noindex
    reverse_proxy ntfy:80
}

import /tmp/proxy_forward.caddy

vpn.yyamashita.com {
    tls {
        key_type rsa4096
    }
    import noindex
    route /ca.pem {
        header Content-Type "application/x-pem-file"
        header Content-Disposition "attachment; filename=\"vpn-ca.pem\""
        file_server {
            root /etc/caddy
        }
    }
    respond "VPN Server" 200
}