我在OpenBSD上创建了以下设置:
所以我的 OpenBSD 服务器192.168.1.250
将所有 http 请求重定向到host-vm
上192.168.30.2
。
它host-vm
本身nginx
用于重定向子域请求,如下所示:
## 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;
}
}
Run Code Online (Sandbox Code Playgroud)
foo.hermes-technology.de
这个请求发送一个 http- request 将被重定向到host-vm
.host-vm
根据子域的名称将请求重定向到foo-vm
.我只想依赖 OpenBSD …