Creating this.
tlsI started with installing OpenBSD 7.1 on a Vultr instance. I ran
syspatch, rebooted.
Then I followed the instructions from the OpenBSD
Handbook to get
httpd running with the following configuration:
server "sch.midt.tech" {
alias "www.sch.midt.tech"
listen on * tls port 443
root "/htdocs/sch.midt.tech"
tls {
certificate "/etc/ssl/sch.midt.tech.fullchain.pem"
key "/etc/ssl/private/sch.midt.tech.key"
}
location "/.well-known/acme-challenge/*" {
root "/acme"
request strip 2
}
}
server "sch.midt.tech" {
alias "www.sch.midt.tech"
listen on * port 80
block return 301 "https://sch.midt.tech$REQUEST_URI"
}
In the ‘OpenBSD Handbook’ they are creating a separate server entry for
blocking and returning requests without the www subdomain. I do not
understand the advantage of this over the alias option, so I
chose the latter.