Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

[Question] IP/Port Binding Multiple Applciations in IIS

Options
  • 24-07-2014 5:26pm
    #1
    Registered Users Posts: 586 ✭✭✭


    Hi Guys. I'm having an issue figuring out the right approach on how to bind the IP and port of a web application on IIS which already hosts another web application on port 80.

    My current setup is this:

    I have a web application which I host on IIS and it is bound to port 80 on a public facing IP address. The way people currently access this application is through a subdomain of our company's website. So our domain host, who also hosts our company website and email, is setup to forward all traffic for this subdomain to my server. This was done by setting up an A record through the control panel of our domain host. IIS then serves up the requested page to the user. There is nothing I don't understand about this part of things.

    Here is what I'm trying to do:

    I have a second application I want to host in IIS but I don't know how to get it to also use port 80. I can't use a different port because I can't realistically expect users to enter a port number into the URL. I wanted this application to be accessed via a different subdomain to the first application. The problem is I don't see how I might go about forwarding traffic from my domain host without using a different port. Due to this I've been using port 8080 but this won't be viable once the web application gets out into the wild.

    So does anyone know what the best approach for doing the above is? Potential solutions I've heard off people are:
    1) Manage the domain myself. But this is not an option since the domain host also hosts the company's email and website.
    2) Bind a second IP to my web server. Sounds viable - but how do I bind the second public IP to my server and in turn to the web application?
    3) Buy a new domain instead of using a subdomain. Not sure how this gets around my issue, in any case the company would prefer to use a subdomain. And I'd sooner figure out how to get it working.

    Ideally I’d like a solution where IIS checks the subdomain used in the incoming request and uses it to resolve to the correct application. I don’t really think this is possible though since I don’t think subdomains were designed to be used at this point in the request chain.

    I might add I’m coming at this as a developer. Typically I’d have IT guys handle things like this but in my current role I don’t really have anyone to pawn this off onto.

    In case it matters, I’m using Windows Server 2008 R2 and IIS 7.5.


Comments

  • Registered Users Posts: 2,022 ✭✭✭Colonel Panic


    IIS can act as a reverse proxy as far as I remember.

    You can have multiple sites on multiple ports on the back end and it'll map incoming requests based on what it calls URL rewrites.

    I can't give any more info, I only know the basics in IIS, I use Nginx for that part of things.


  • Registered Users Posts: 586 ✭✭✭Aswerty


    Thanks for the info. A quick google of "IIS reverse proxy" bring up some interesting results. I'll delve into it tomorrow at work.

    From the sound of it though I should be able to do what I wanted; check the subdomain of the incoming request and route it to the desired application.


  • Registered Users Posts: 1,477 ✭✭✭azzeretti


    Why not user simple host headers?

    When you say the hosting company is forwarding traffic what do you mean? Is the lookup resolving to their server first and then being redirected or is it that they just mange the DNS server, and the A record pointing at your public IP? If the latter you can setup IIS to listen on one IP and port but resolve many domains/sub domains by using host headers.

    EDIT: you mention application, do you mean separate apps outside of IIS? I'd so then host headers won't work and, as mentioned above, a reverse proxy is what you need!


  • Registered Users Posts: 773 ✭✭✭seklly


    I do the something similar using managed fusion rewriter, everything comes in on port 80 to IIS and gets redirected to each local application.


  • Registered Users Posts: 586 ✭✭✭Aswerty


    azzeretti wrote: »
    Why not user simple host headers?

    When you say the hosting company is forwarding traffic what do you mean? Is the lookup resolving to their server first and then being redirected or is it that they just mange the DNS server, and the A record pointing at your public IP? If the latter you can setup IIS to listen on one IP and port but resolve many domains/sub domains by using host headers.

    EDIT: you mention application, do you mean separate apps outside of IIS? I'd so then host headers won't work and, as mentioned above, a reverse proxy is what you need!

    I'm not 100% on this but I believe the host is just managing the DNS server and A record. I will have a look into simple host headers to see if they solve my problem.

    As to your edit, any reference to an application in my post was a reference to a web application.


  • Advertisement
  • Registered Users Posts: 586 ✭✭✭Aswerty


    Well I have it working. Thanks for the help guys. It turns out the solution by azzeretti did the job. All I ended up doing was specifying the specific subdomain in the host name in my site binding. I didn't think it would be that simple!


  • Registered Users Posts: 773 ✭✭✭seklly


    Yes, that's a much simpler solution, the way I use the one I mentioned is to redirect to applications running on different ports internally so that they can all be accessed from port 80 externally


Advertisement