On Mon, Nov 25, 2024 at 6:40 AM prx <p...@si3t.ch> wrote: > Hi, > I can't figure out how to assign a domain name to a client vm. > What I need to do is to redirect traffic on the appropriate vm according > to the domain name. >
The way you do this is to assign a unique external IP address for each domain name. Then it is straightforward to redirect each external IP to a specific internal host or VM. Alternatively you can also do this using specific ports, where $(EXT_IP):443 goes to one VM, $(EXT_IP):444 goes to another, etc. HTTP allows a single server to support multiple virtual hosts, but you won't know which host is being requested until after the connection has been established using IP address and port only. Once the session is connected, the client then includes a "Host" header with their request to tell the HTTP server which virtual host they are trying to connect to. As this is all done after the session is already established PF would not be used here, as PF needs to know what to do at the time the session is being established, not afterwards. To work around this issue for HTTP you would set up a proxy server through which all your sessions pass, e.g. squid. -ken