openbsd: update relayd and httpd configuration files

* httpd: use proper server names
* httpd: add example of a very basic static website along with Pleroma
* httpd: let Pleroma serve robots.txt
* relayd: add example of forwarding to a basic httpd website
* relayd: remove appended response headers (most of them already served
  by Pleroma anyway)
* relayd: add comments about hosting Pleroma on subdomains
* relayd: reject request that don't belong to any forward
* relayd: add example of hosting media uploads on subdomain
* relayd: change forward timeout check to something sane that actually
  works
This commit is contained in:
Phantasm 2024-11-11 23:48:33 +01:00
commit 3dc2655f59
No known key found for this signature in database
GPG key ID: 2669E588BCC634C8
2 changed files with 53 additions and 20 deletions

View file

@ -4,8 +4,9 @@
# 1. Place file in /etc
# 2. Replace <IPv4 address> with your public IP address
# 3. If using IPv6, uncomment IPv6 lines and replace <IPv6 address> with your public IPv6 address
# 4. Check file using 'doas httpd -n'
# 5. Enable and start httpd:
# 4. Replace all occurences of example.tld with your instance's domain name.
# 5. Check file using 'doas httpd -n'
# 6. Enable and start httpd:
# # doas rcctl enable httpd
# # doas rcctl start httpd
#
@ -13,7 +14,7 @@
ext_inet="<IPv4 address>"
#ext_inet6="<IPv6 address>"
server "default" {
server "example.tld" {
listen on $ext_inet port 80 # Comment to disable listening on IPv4
# listen on $ext_inet6 port 80 # Comment to disable listening on IPv6
listen on 127.0.0.1 port 80 # Do NOT comment this line
@ -26,10 +27,18 @@ server "default" {
request strip 2
}
location "/robots.txt" { root "/htdocs/local/" }
location "/*" { block return 302 "https://$HTTP_HOST$REQUEST_URI" }
}
# Example of serving a basic static website besides Pleroma using the example configuration in relayd
#server "site.example.tld" {
# listen on 127.0.0.1 port 8080
#
# location "/*" {
# root "/website"
# }
#}
types {
include "/usr/share/misc/mime.types"
}