# $OpenBSD: httpd.conf,v 1.20 2018/06/13 15:08:24 reyk Exp $ prefork 2 chroot "/home/www" # REDIRECT TO HTTPS (EXCEPT LETSENCRYPT) server "codevoid.de" { alias "gopher.codevoid.de" listen on * port 80 location "/.well-known/acme-challenge/*" { root "/acme" request strip 2 } location * { block return 302 "https://$HTTP_HOST$REQUEST_URI" } } # CGI SCRIPT TO RETURN REQUESTER IP (V4 OR V6) server "ip.codevoid.de" { listen on * tls port 443 listen on * port 80 log style forwarded tls { certificate "/tls/codevoid.de.full.cer" key "/tls/codevoid.de.key" } location "/.well-known/acme-challenge/*" { root "/acme" request strip 2 } root "/cgi-bin/ip" fastcgi socket "/run/slowcgi.sock" } server "codevoid.de" { alias "gopher.codevoid.de" listen on * tls port 443 log style forwarded tls { certificate "/tls/codevoid.de.full.cer" key "/tls/codevoid.de.key" } # LETSENCRYPT ON 443 (NOT REALLY NEEDED) location "/.well-known/acme-challenge/*" { root "/acme" request strip 2 } # HTML STUFF location "/h/*" { root "/htdocs/http" directory auto index request strip 1 } # CSS location "/*.css" { root "/css" } # FONTS location "/*.woff2" { root "/css/fonts" } # BG IMAGE location "/bg.gif" { root "/css" } # FAVICON location "/favicon.ico" { root "/css" } # GOPHER PROXY REWRITES location match "^/$" { request rewrite "/gate?q=/1/index.dcgi" } location "/robots.txt" { request rewrite "/gate=?q=/0/robots.txt" } location match "^/1/tw$" { request rewrite "/gate?q=/1/tw?$QUERY_STRING" } location match "^/1/cnn$" { request rewrite "/gate?q=/1/cnn?$QUERY_STRING" } location match "^/ip$" { request rewrite "/gate?q=/1/ip" } location match "^/gpg$" { request rewrite "/gate?q=/0/pubkey.gpg" } location match "^/0/gpg$" { request rewrite "/gate?q=/0/pubkey.gpg" } location match "^/idgen$" { request rewrite "/gate?q=/1/idgen" } location match "^/fixme$" { request rewrite "/gate?q=/1/fixme" } location match "^/excuse$" { request rewrite "/gate?q=/1/excuse" } location match "^/breached$" { request rewrite "/gate?q=/1/excuse" } location match "^/hacked$" { request rewrite "/gate?q=/1/excuse" } location match "^/sap$" { request rewrite "/gate?q=/1/sap" } location match "^/tw.txt$" { request rewrite "/gate?q=/0/tw.txt" } location match "^/8ball$" { request rewrite "/gate?q=/1/8ball" } location match "^/8Ball$" { request rewrite "/gate?q=/1/8Ball" } location match "^/robots.txt$" { request rewrite "/gate?q=/0/robots.txt" } # GOPHER PATH location match "^/([%dI])/(.*)$" { request rewrite "/gate?q=/%1/%2" } # GATEWAY TO OTHER GOPHERS location match "^/gate/$" { request rewrite "/$QUERY_STRING" } # PROXY CATCHALL location * { root "/cgi-bin/gopherproxy" fastcgi socket "/run/slowcgi.sock" } }