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