Multiple web servers same port

SuperMiguel

Renowned Member
Mar 30, 2010
30
0
71
So i have a proxmox setup with multiple webservers containers having different data, i will like to access them with subdomains, for example server1.example.com should point to 192.168.1.10:80 and server2.example.com should point to 192.168.1.11:80, what's the best way of doing? Im pretty sure it can be done with a 3rd vm running something like nginx and running reverse proxy, but just looking for opinions on whats the best way?
 
Hi,

normally you do this with a dns server.
 
Not sure if dns helps, as both server1.example.com and server2.example.com have to resolve to the same public IP proxmox is using. And iptables-routing is done using protocol/port/ip, not fqdn.

In this case I think the easiest and most reliable solution is to use reverse proxy (nginx, varnish, etc). This can then route traffic to multiple back-end web servers based on hostname in requests...
 
Last edited: