How to redirect two domains to same local server IP with pfSense

pfsense

I am planning to setup the firewall before my webserver in cloud that hosts 3 websites. However, all the three websites are proxied by cloudflare. So my question is it possible to map the public IP of PFsense in cloudflare and inturn PFsense will forward the http requests to webserver accordingly to each website:

Cloudflare –> PFsense public IP –> site1.com(connected to pfsense through private IP)
2)Cloudflare –> PFsense public IP –> site2.com(connected to pfsense through private IP)
Cloudflare –> PFsense public IP –> site3.com(connected to pfsense through private IP)
If it is possible, please provide me the steps to achieve this, thanks in advance.

PFSense domain forwarding

Best Answer

Instead of relying on PfSense for this, configure your web server to handle multiple domains. This is possible with most web server software; for Apache httpd or Nginx, you can create multiple virtual hosts or server blocks, respectively, each of which is responsible for serving a single domain.

Related Topic