Without more information it seems the answer is just generally:
The Packet Filter (pf
) is what you use to route the packets to each service and based on what you have posted so far, it appears you can use just pf
and the web server (httpd
), unless there is some other reason you feel you need a reverse proxy.
Simple pf.conf
example:
ext_if = "vio0"
ext_srvcs_in = "{ 70, 80, 443, 6697 }"
set skip on lo
# Not mentioned in question, but assuming you want SSH with common adaptive config:
pass in quick on $ext_if proto tcp to port ssh \
keep state (max-src-conn 15, max-src-conn-rate 5/3, \
overload <bruteforce> flush global)
pass out quick on $ext_if
block all
pass in on $ext_if proto {tcp, udp} to port $ext_srvcs_in
When you configure your services, they should bind to the ports and pf
will route to them. For multiple subdomains on httpd
just use multiple server blocks as described in httpd.conf(5)
. For example:
types { include "/usr/share/misc/mime.types" }
server "example.com" {
alias "www.example.com"
listen on * port 80
listen on * tls port 443
tls {
certificate "/etc/ssl/example.com.fullchain.pem"
key "/etc/ssl/private/example.com.key"
}
location "/.well-known/acme-challenge/*" {
root "/htdocs/example.com"
request strip 2
}
root "/var/www/htdocs/example.com"
directory index index.htm
}
server "img.example.com" {
listen on * port 80
listen on * tls port 443
tls {
certificate "/etc/ssl/example.com.fullchain.pem"
key "/etc/ssl/private/example.com.key"
}
location "/.well-known/acme-challenge/*" {
root "/htdocs/img.example.com
request strip 2
}
root "/var/www/htdocs/img.example.com"
directory index index.htm
}