Single WAN IP with Multiple App-servers/web servers



  • 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



  • 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.



  • 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



  • 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?



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



  • 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



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



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


Locked