I have a two home server VMs set up. Windows 2008 server on port 80 and Centos/Redhat on port 8080. Both have separate godaddy domain name A name records pointing to them. But I cant point both domain to the same IP I only have 1 wan ip address at home. So one of my domain is forward to my IP:8080. My question: Is it possible for my windows server to redirect a certain domain name to my Linux server on port 8080? So i Have mysite1.com going to windows and mysite2.com also going to the windows server but windows would redirect mysite2.com traffic to the linux ip address:8080. I want to access both sites at my work and my work firewall is strict and will not allow domain forwarding from godaddy.
migrated from serverfault.com Dec 19 '12 at 1:01
This question came from our site for professional system and network administrators.
My understanding is that you already have your router forwarding port 80 to Windows and port 8080 to Linux. Now you are trying to solve the issue of people typing in the domain name for the Linux server without the ":8080" and that traffic going to the windows box.
The solution is to create two websites in IIS and set them both to listen on the same IP address. The only difference will be the host header. That way when the web traffic reaches IIS it will look at the URL and direct the traffic to the right website based on the domain name. Here is the TechNet article on creating host headers. http://technet.microsoft.com/en-us/library/cc753195(v=ws.10).aspx
After that is done all you need to do is setup the redirect of all traffic to the IIS Linux website to http://LinuxDomainName:8080 You can either write a redirect page in HTML or use the "HTTP Redirect" module in IIS. http://technet.microsoft.com/en-us/library/cc770409(v=ws.10).aspx
Hope this helps...
|show 4 more comments|
What you're talking about is a Reverse Proxy. IIS appears to be able to do it, but I have no experience with IIS. In apache terminology, you need to use the proxy modules, with a VirtualHost for each domain (mysite1.com and mysite2.com). The Reverse Proxy then makes the request to each server (Windows or the CentOS/RedHat box) depending on which VirtualHost the original request was sent to.
The user (or you) enters whichever address you want (mysite1.com or mysite2.com) in their browser, which connects to the Reverse Proxy. The reverse proxy uses the HTTP "host" header to determine which site it needs to return, and it worries about the ports. The remote user is never aware that the CentOS/RedHat box is actually listening on 8080.
There are appears to be quite a bit of information in Google if you search for
You certainly can have both A records point to the same ip address. On your router/firewall you'll configure port forwarding for port 80 to go to one server and port 8080 to go to the other server.
Incoming traffic to x.x.x.x:80 will go to one server and traffic to x.x.x.x:8080 will go to the other server.