Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    use NAT to forward from 2 domains to 2 webservers?

    Scheduled Pinned Locked Moved NAT
    2 Posts 2 Posters 515 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      helloha
      last edited by

      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.

      V 1 Reply Last reply Reply Quote 0
      • V
        viragomann @helloha
        last edited by

        @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

        1 Reply Last reply Reply Quote 1
        • First post
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.