]> Lady’s Gitweb - x_status_git/blob - Caddyfile
Fail on git clone error
[x_status_git] / Caddyfile
1 status.site.example {
2 root * /home/USERNAME/status.site.example/public
3
4 @slash {
5 path_regexp slash /$
6 }
7
8 @jsonld {
9 path_regexp jsonld \.jsonld$
10 }
11
12 @bare {
13 not path_regexp /$
14 not path_regexp \.jsonld$
15 }
16
17 @empty {
18 expression {re.matcher.suffix} == ""
19 }
20
21 handle / {
22 rewrite * /index.html
23 header Link </about.jsonld>;rel=meta;type="application/ld+json"
24 }
25
26 handle /about {
27 rewrite * /.about.html
28 header Link </about.jsonld>;rel=meta;type="application/ld+json"
29 }
30
31 redir /about/ /about
32
33 rewrite /about.jsonld /about/index.jsonld
34
35 handle /statuses {
36 rewrite * /.statuses.html
37 header Link </statuses.jsonld>;rel=meta;type="application/ld+json"
38 }
39
40 redir /statuses/ /statuses
41
42 rewrite /statuses.jsonld /statuses/index.jsonld
43
44 @dated {
45 path_regexp matcher ^/statuses/(?P<ym>\d{4}-\d{2})(?P<suffix>/[^/.]+)?(?:\..*|/)?$
46 not path_regexp ^/statuses/index[/.]?
47 }
48
49 handle @dated {
50 handle @empty {
51 handle @bare {
52 rewrite * /.topic.html
53 header Link </statuses/{re.matcher.ym}.jsonld>;rel=meta;type="application/ld+json"
54 }
55
56 handle @slash {
57 redir * /statuses/{re.matcher.ym}
58 }
59
60 handle @jsonld {
61 rewrite * /statuses/{re.matcher.ym}/index.jsonld
62 }
63 }
64
65 handle {
66 handle @bare {
67 rewrite * /.status.html
68 header Link </statuses/{re.matcher.ym}.jsonld>;rel=meta;type="application/ld+json"
69 }
70
71 handle @slash {
72 redir * /statuses/{re.matcher.ym}{re.matcher.suffix}
73 }
74 }
75 }
76
77 handle /topics {
78 rewrite * /.topics.html
79 header Link </topics.jsonld>;rel=meta;type="application/ld+json"
80 }
81
82 redir /topics/ /topics
83
84 rewrite /topics.jsonld /topics/index.jsonld
85
86 @topics {
87 path_regexp matcher ^/topics/(?P<topic>[0-9A-Za-z_-]+)(?P<suffix>/[^/.]+)?(?:\..*|/)?$
88 not path_regexp ^/topics/index[/.]?
89 }
90
91 handle @topics {
92 handle @empty {
93 handle @bare {
94 rewrite * /.topic.html
95 header Link </topics/{re.matcher.topic}.jsonld>;rel=meta;type="application/ld+json"
96 }
97
98 handle @slash {
99 redir * /topics/{re.matcher.topic}
100 }
101
102 handle @jsonld {
103 rewrite * /topics/{re.matcher.topic}/index.jsonld
104 }
105 }
106
107 handle {
108 handle @bare {
109 rewrite * /.status.html
110 header Link </topics/{re.matcher.topic}.jsonld>;rel=meta;type="application/ld+json"
111 }
112
113 handle @slash {
114 redir * /topics/{re.matcher.topic}{re.matcher.suffix}
115 }
116 }
117 }
118
119 header Access-Control-Allow-Origin "*"
120
121 file_server {
122 index index.xml index.xhtml index.html index.rdf index.txt
123 }
124 }
This page took 0.11321 seconds and 5 git commands to generate.