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

    Single WAN IP with Multiple App-servers/web servers

    Scheduled Pinned Locked Moved DHCP and DNS
    8 Posts 4 Posters 3.4k 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.
    • M
      mrmastii
      last edited by

      Hello:
      I apologize if this question is in wrong place.

      Question:
      I need some direction,
      I have 1 static WAN IP address [can’t have more than one with my service]

      My domain from external dns is pointing this static IP
      I also have sub-domain pointing to same static IP.
      This is done so that this IP will be entry point.
      So if I “ping mydomain.com” it will resolve to 80.x.x.7 and “dev.mydomain.com” to same.

      Inside my PFSense I have main domain with few machines on 192.168.1.0 to 192.168.1.25

      Additionally I have sub domain dev with few machines on 192.168.1.100 to 192.168.1.125

      How or what should I be configuring so that if someone wants to access www.mydomain.com it should take the prod webserver
      and if www.dev.mydomain.com is entered it will be taken to dev webserver

      –Internet-----WAN-Static IP-----[PF Sense]–--[```````[sup]Prod(192.168.1.25) _____Dev(192.168.1.100)

      Help is much appreciated
      -Kashif

      1 Reply Last reply Reply Quote 0
      • B
        blak111
        last edited by

        This would have to be done on your webserver. pfSense doesn't pay attention to the hostname that the user is using to access the site.

        You could setup a virtual host on your production webserver that takes requests to www.dev.mydomain.com and redirects them to another port that is forwarded to the dev server.

        1 Reply Last reply Reply Quote 0
        • M
          mrmastii
          last edited by

          Thanks for the reply blak111
          I have tried this approach, and I am getting page not found.
          You mention that to use different port, the app is port specific like 8080, if I redirect on different port the app will not work

          Any suggestion be appreciated
          -Kashif

          1 Reply Last reply Reply Quote 0
          • B
            blak111
            last edited by

            Yeah, I think your only option is then to get another external IP to work with or maybe have people that need access to the dev server use a VPN and access the private address.

            If they are using a web browser to access the site, it should be okay to have a different on port on the outside redirecting to the 8080 on the inside. Is the port number built into a client they use?

            1 Reply Last reply Reply Quote 0
            • C
              cmb
              last edited by

              With one IP, you have to do something like this.
              http://doc.m0n0.ch/handbook/thirdparty-apache-virtualhosts.html

              1 Reply Last reply Reply Quote 0
              • M
                mrmastii
                last edited by

                blak111 and cmb,
                Thanks for your input. both of your suggestion are informative.
                With my ISP / my account I cant have more than one IP.
                so , I will combine both of your suggestions, to create VPN and config web for virtual host…only thing that I need to investigate is IIS equivalent solution

                thanks again

                cheers

                -Kashif

                1 Reply Last reply Reply Quote 0
                • B
                  blak111
                  last edited by

                  Both IIS and Apache can do the name based virtual hosts so you should be ok.

                  1 Reply Last reply Reply Quote 0
                  • G
                    ginosteel
                    last edited by

                    if u have apache just install plesk and all it`s done. U can do this easy from Plesk panel.

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