Avatar of Paweld
Paweld

asked on 

How do I forward requests to different ports based on a domain they came from?

Hi All

Below is a question regarding port forwarding in Linux that someone asked and got a reply
already. I'm just reposting a version modified to my situation.
Could someone help me out on how to do this in Windows Server 2008 please?

My company has a IIS server running an application. They would like to host it from different ports to different clients; how to forward the requests to a specific port based on the domain name?

In a nutshell I want www.firstdomain.com/app to go to 8080 and www.seconddomain.com/app to go to port 8081 seemlessly with sessions etc... (I do not want people to see the trailing port numbers by the way)
We don't host firstdomain nor the seconddomain as they are our customers buying the app so I can't change their DNS records etc.

Also if it turns out that we can modify their dns entries, would it be possible to create a dns record pointing to our server and a port?


Appreciate any help,
Thanks,
Pawel.

DNSWindows Server 2008Microsoft IIS Web Server

Avatar of undefined
Last Comment
Paweld
SOLUTION
Avatar of Papertrip
Papertrip
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of jakethecatuk
jakethecatuk
Flag of United Kingdom of Great Britain and Northern Ireland image

if you are using specific domain names, then using port numbers isn't really required as you can use host headers and bindings on IIS.

So, you would have your IIS server with the IP address of 1.1.1.1

You would create DNS entries for www.firstdomain.com and www.seconddomain.com and give them the same IP address of 1.1.1.1

On your IIS server, you would have multiple websites and under the properties, you would specify the URL that the website should accept traffic for.

Failing that, you could do this at a firewall level.
Avatar of Paweld
Paweld

ASKER

Thanks guys,

Jakethecatuk - can I only just ask why do I have to create DNS entries?
I found the IIS Bindings as you said, and I can add one of my own so it looks something like this:

Protocol: http;
IP Address: Any assigned or 192.168.0.2, so I chose the latter (I can also type external IP address, which I probably should do?)
Port: I put a port name I want
URL: www.firstdomain.com

Is this what you were talking about? If so, then why do I create DNS entries? Is it because I don't host www.firstdomain.com? I will only host the 'app' bit if it's at all possible (www.firstdomain.com/APP)
Avatar of jakethecatuk
jakethecatuk
Flag of United Kingdom of Great Britain and Northern Ireland image

you need DNS entries for www.firstdomain.com and www.seconddomain.com etc as they need to know where to find the website - no DNS, then no way to your servers.

Now you've said something which is will probably screw everything up.  You have said '... I will only host the 'app' bit if it's at all possible (www.firstdomain.com/APP)...' - who is going to be hosting www.firstdomain.com?  If it's not on the same server as your APP, then things get very interesting on how to achieve your goal.
Avatar of Paweld
Paweld

ASKER

Ok, talked to developers and asked how exactly they wanted it:

We will have something like www.ourdomain.com/client_a (one for each client obviously)
www.clientsite.com/APP has to point to a corresponding site on our server.

So technically this could be done with IIS Binding?
ASKER CERTIFIED SOLUTION
Avatar of jakethecatuk
jakethecatuk
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of Paweld
Paweld

ASKER

As pointed out by jakethecatuk what we wanted to achieve was not doable.
Instead we will be asking customers to create a subdomain and then point them to our servers
Thanks and sorry for delay!
Windows Server 2008
Windows Server 2008

Windows Server 2008 and Windows Server 2008 R2, based on the Microsoft Vista codebase, is the last 32-bit server operating system released by Microsoft. It has a number of versions, including including Foundation, Standard, Enterprise, Datacenter, Web, HPC Server, Itanium and Storage; new features included server core installation and Hyper-V.

86K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo