Situation
I created the following setup on OpenBSD:
So I have my OpenBSD server on 192.168.1.250
redirecting all http-requests to the host-vm
on 192.168.30.2
.
The host-vm
itself operates nginx
for redirecting subdomain-requests like so:
## the virtual server for the foo-vm
server {
listen 80;
server_name foo.hermes-technology.de;
location / {
proxy_pass http://192.168.30.3;
}
}
## the virtual server for the bar-vm
server {
listen 80;
server_name bar.hermes-technology.de;
location / {
proxy_pass http://192.168.30.4;
}
}
- So if users send a http-request to
foo.hermes-technology.de
this request will be redirected to thehost-vm
. - Thereafter the
host-vm
redirects the request based on the name of the subdomain to the local ip of thefoo-vm
.
Question
I would like to be dependent only on base packages of OpenBSD, so my question is:
How is it possible to redirect subdomain requests on the host machine to other local ip-addresses, achieving the same result as above only using httpd
and relayd
?
More Information
If you need or want more information on this setup for answering my question I have a writeup of the whole configuration here: blog.hermes-technology.de.