I have one public static IP address.
I have my main domain register at local Internet provider and their DNS.
My main router is pfSense and behind it i have my local network.
My WEB server is in local LAN and pfSense doing NAT (port redirect) WEB traffic to local server.
Now I need one more web server inside my LAN (on another local IP address) (etc mail server) and I need another domain or subdomain.
Can I register a new domain pointed to the same public IP address, and tell pfSense to do different redirecting of traffic according to domain? I am planing to use both domains under HTTP (80) port.
Is it possible to pFsense redirect to one local IP when request calling domain.com
and to do different port forwarding when request on the same public IP adders calling subdomain.domain.com ?
If this is possible which one of Pfsense modules I should I install and configure, and how?
Best Answer
This can be done with the squid3 package. squid3 includes a Reverse Proxy server
Install the squid3 package...
After installation go to Services > Reverse Proxy
Under the General tab...
Under the Web Servers tab, add the (internal) IP of each of your servers
Under the Mappings tab, add the domain name for each of your servers
Finally, under Firewall > Rule, create rule to direct traffic to the reverse proxy server
This rule should be LAST if you have other rules configured forwarding from the outside in.
Any names you use must be registered to point to your external IP-- so if your domain name is example.com, in order to create subdomains in pfsense you will need to setup a record with your domain registrar point *.example.com.
I learned from this helpful tutorial: http://sdrv.ms/V8qLfK