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

    Multiple Webserver, one public IP

    Scheduled Pinned Locked Moved NAT
    5 Posts 4 Posters 2.8k 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.
    • J
      jomarski
      last edited by

      I have PFsense as my firewall/router. The problem is I want to host two webserver using 1 public IP

      on PFsense NAT I use different ports. One  is 80(1st webserver)  the other one is 8081(2nd webserver).

      Within our LAN it works but when accessing it outside it fails.

      Is theres something that I must do besides configuring the NAT?

      Thanx

      1 Reply Last reply Reply Quote 0
      • johnpozJ
        johnpoz LAYER 8 Global Moderator
        last edited by

        you have to access it via port on your url from outside

        http://something.publicdomain.tld

        would access default port 80 and and your forward of port 80 to 1st webserver

        if you forwarded 8081 to 2nd server, then you would access via

        http://something.publicdomain.tld:8081

        if you want to access via some different name, then you would have to use a reverse proxy on pfsense to know that

        name.publicdomain.tld goes to webserver 1, and other.publicdomain.tld goes to webserver 2.  If using a reverse proxy then both servers could be on port 80.  And would not be needed in the url

        If not using a proxy then the only way to access different webservers behind your nat is to use different ports like what your doing.  but you have to spell out that other port in the url used to access it.

        An intelligent man is sometimes forced to be drunk to spend time with his fools
        If you get confused: Listen to the Music Play
        Please don't Chat/PM me for help, unless mod related
        SG-4860 24.11 | Lab VMs 2.8, 24.11

        1 Reply Last reply Reply Quote 0
        • ?
          Guest
          last edited by

          You could use Apache's virtual server parms so you can keep using port 80 across multiple websites on a single IP.
          http://httpd.apache.org/docs/2.2/vhosts/examples.html

          1 Reply Last reply Reply Quote 0
          • johnpozJ
            johnpoz LAYER 8 Global Moderator
            last edited by

            ^ yup that would be only 1 webserver though behind pfsense.

            Nothing running on the webserver would allow for pfsense to send it to different webserver, that has to be done with reverse proxy on pfsense.

            An intelligent man is sometimes forced to be drunk to spend time with his fools
            If you get confused: Listen to the Music Play
            Please don't Chat/PM me for help, unless mod related
            SG-4860 24.11 | Lab VMs 2.8, 24.11

            1 Reply Last reply Reply Quote 0
            • S
              SysIT
              last edited by

              Reverse Proxy.

              the reverse proxy hands all incoming connections and based on HTTP headers would direct to the LAN server you set it yo.

              ¸,ø¤°`°¤ø,¸© Poor Planning On Your Part Does Not Constitute An Emergency On My Part ©¸,ø¤°`°¤ø,¸
              ¸,ø¤°`°¤ø,¸© The trouble with life is there’s no background music ©¸,ø¤°`°¤ø,¸
              ¸,ø¤°`°¤ø,¸© Life isnt short, you're just dead for too long©¸,ø¤°`°¤ø,¸

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