use NAT to forward from 2 domains to 2 webservers?
-
I have a small webserver on my network and use pfsense to do the port forwarding.
Next to that I'm experimenting with proxmox to virtualize a new webserver.
Is it possible to use NAT to rout traffic from one specific domain to one internal IP (the current webserver) and another domain to another internal IP (the virtual webserver)
Or would it be easier to use HTTP (port 80) on the testing server and switch to HTTPS when all is tried and tested. I'm only using HTTPS on the current webserver anyways.
Thanks for any feedback!
Karel. -
@helloha
pfSense cannot see the domain inside the HTTP request. NAT works simply on layer 3, the host name is only available on layer 7.
This can only be done with a reverse proxy package on pfSense like HAproxy.For testing you can as well use any unused port and forward it to the other server, you just have to state the port in the request if its not 80 or 443, e.g. host.yourdomain.com:81