Having two subdomains on one public IP addres bheind pFsense router

  • I have one pubic 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 trafic to local server.
    Now I have needs for one more web server inside lan (on other local IP addres) (etc mail server) and I have needs for one more domain or sub domain whatever. Can I register my new domain under same public IP address, and tell pFsenes router to do different redirecting of traffic according to requested domain. I am planing to use both domens 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 posibile whic one of Pfsense modules I shud install and configure, and how?

  • Reverse proxy - I don't use it but there are how-too threads I imagine.

  • I´m doing that with Squid3 package that has reverse proxy.
    Don´t know where I found the howto but here is a short recap of what I did.

    • Remove old NAT and FW rule for port 80

    • Add new NAT on WAN for port 80 to and a new choosen port for example 9000

    • Add new FW rule on WAN with dest port 9000

    • In squid3 general set interface to loopback, set you external address in FQDN, enable reverse proxy on port 9000

    • In squid3 webservers add your servers with their IP data

    • In squid3 mappings map your servers to the right domain names for example "www.example.com" and "example.com"

    Think that was all there was to it.

Log in to reply