summaryrefslogtreecommitdiff
path: root/frontends/etc/httpd.conf.tpl
blob: 6902ed4ccb9b82585b69f95e407bbb26a42ff1b2 (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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<%
  our $primary = $is_primary->($vio0_ip);
  our $prefix = $primary ? '' : 'www.';
%>

# Plain HTTP for ACME and HTTPS redirect
<% for my $host (@$acme_hosts) { %>
server "<%= $prefix.$host %>" {
  listen on * port 80
  location "/.well-known/acme-challenge/*" {
    root "/acme"
    request strip 2
  }
  location * {
    block return 302 "https://$HTTP_HOST$REQUEST_URI"
  }
}
<% } %>

# Current server's FQDN (e.g. for mail server ACME cert requests)
server "<%= "$hostname.$domain" %>" {
  listen on * port 80
  location "/.well-known/acme-challenge/*" {
    root "/acme"
    request strip 2
  }
  location * {
    block return 302 "https://<%= $prefix %>buetow.org"
  }
}

# Gemtexter hosts
<% for my $host (qw/foo.zone snonux.land paul.buetow.org/) { %>
server "<%= $prefix.$host %>" {
  listen on * tls port 443
  tls {
    certificate "/etc/ssl/<%= $prefix.$host %>.fullchain.pem"
    key "/etc/ssl/private/<%= $prefix.$host %>.key"
  }
  location * {
    root "/htdocs/gemtexter/<%= $host %>"
    directory auto index
  }
}
<% } %>

# Redirect to paul.buetow.org
<% for my $host (qw/buetow.org paul.cyou/) { %>
server "<%= $prefix.$host %>" {
  listen on * tls port 443
  tls {
    certificate "/etc/ssl/<%= $prefix.$host %>.fullchain.pem"
    key "/etc/ssl/private/<%= $prefix.$host %>.key"
  }
  location * {
    block return 302 "https://<%= $prefix %>paul.buetow.org"
  }
}
<% } %>

# Redirec to to gitub.dtail.dev
server "<%= $prefix %>dtail.dev" {
  listen on * tls port 443
  tls {
    certificate "/etc/ssl/<%= $prefix %>dtail.dev.fullchain.pem"
    key "/etc/ssl/private/<%= $prefix %>dtail.dev.key"
  }
  location * {
    block return 302 "https://github.dtail.dev$REQUEST_URI"
  }
}

# Irregular Ninja special host
server "<%= $prefix %>irregular.ninja" {
  listen on * tls port 443
  tls {
    certificate "/etc/ssl/<%= $prefix %>irregular.ninja.fullchain.pem"
    key "/etc/ssl/private/<%= $prefix %>irregular.ninja.key"
  }
  location * {
    root "/htdocs/irregular.ninja"
    directory auto index
  }
}

# Dory special host
server "<%= $prefix %>dory.buetow.org" {
  listen on * tls port 443
  tls {
    certificate "/etc/ssl/<%= $prefix %>dory.buetow.org.fullchain.pem"
    key "/etc/ssl/private/<%= $prefix %>dory.buetow.org.key"
  }
  location * {
    root "/htdocs/joern/dory.buetow.org"
    directory auto index
  }
}

server "<%= $prefix %>tmp.buetow.org" {
  listen on * tls port 443
  tls {
    certificate "/etc/ssl/<%= $prefix %>tmp.buetow.org.fullchain.pem"
    key "/etc/ssl/private/<%= $prefix %>tmp.buetow.org.key"
  }
  root "/htdocs/buetow.org/tmp"
  directory auto index
}

server "<%= $prefix %>footos.buetow.org" {
  listen on * tls port 443
  tls {
    certificate "/etc/ssl/<%= $prefix %>footos.buetow.org.fullchain.pem"
    key "/etc/ssl/private/<%= $prefix %>footos.buetow.org.key"
  }
  root "/htdocs/buetow.org/footos"
  directory auto index
}

server "<%= $prefix %>fotos.buetow.org" {
  listen on * tls port 443
  tls {
    certificate "/etc/ssl/<%= $prefix %>fotos.buetow.org.fullchain.pem"
    key "/etc/ssl/private/<%= $prefix %>fotos.buetow.org.key"
  }
  root "/htdocs/buetow.org/fotos"
  directory auto index
}

# Legacy hosts
server "snonux.de" {
  alias "www.snonux.de"
  listen on * port 80
  block return 302 "https://snonux.land"
}

server "snonux.de" {
  alias "www.snonux.de"
  listen on * tls port 443
  tls {
    certificate "/etc/ssl/snonux.de.fullchain.pem"
    key "/etc/ssl/private/snonux.de.key"
  }
  block return 302 "https://snonux.land$REQUEST_URI"
}

server "foo.surf" {
  alias "www.foo.surf"
  listen on * port 80
  block return 302 "https://foo.zone$REQUEST_URI"
}

server "foo.surf" {
  alias "www.foo.surf"
  listen on * tls port 443
  tls {
    certificate "/etc/ssl/foo.surf.fullchain.pem"
    key "/etc/ssl/private/foo.surf.key"
  }
  block return 302 "https://foo.zone$REQUEST_URI"
}

server "sidewalk.ninja" {
  alias "www.sidewalk.ninja"
  listen on * port 80
  block return 302 "https://irregular.ninja$REQUEST_URI"
}

server "sidewalk.ninja" {
  alias "www.sidewalk.ninja"
  listen on * tls port 443
  tls {
    certificate "/etc/ssl/sidewalk.ninja.fullchain.pem"
    key "/etc/ssl/private/sidewalk.ninja.key"
  }
  block return 302 "https://irregular.ninja$REQUEST_URI"
}

# Defaults
server "default" {
  listen on * port 80
  block return 302 "https://foo.zone$REQUEST_URI"
}

server "default" {
  listen on * tls port 443
  tls {
    certificate "/etc/ssl/foo.zone.fullchain.pem"
    key "/etc/ssl/private/foo.zone.key"
  }
  block return 302 "https://foo.zone$REQUEST_URI"
}