# $OpenBSD: httpd.conf,v 1.20 2018/06/13 15:08:24 reyk Exp $ server "{{ fqdn }}" { listen on * port 80 location "/.well-known/acme-challenge/*" { root "/acme" request strip 2 } {% if not tls %} location "/pub/*" { directory auto index } {% endif %} {% if tls %} location * { block return 302 "https://$HTTP_HOST$REQUEST_URI" } {% endif %} } {% if st_tls.results.0.stat.exists and st_tls.results.1.stat.exists and tls %} server "{{ fqdn }}" { listen on * tls port 443 tls { certificate "{{ tls_certificate }}" key "{{ tls_key }}" } location "/pub/*" { directory auto index } location "/.well-known/acme-challenge/*" { root "/acme" request strip 2 } } {% endif %}