Link to home
Start Free TrialLog in
Avatar of GenieMaster
GenieMaster

asked on

Website says Bad Request (Invalid Hostname)

We have a website that is currently running fine on our iis6 web server

IP Address 192.168.1.2
TCP Port 80
Host Header Value : www.websiteexample.com 

Directory of files: C:\Websites\livesite

As we are occasionally making changes and updates to the website. I want to publish a beta version of the website that I can test on before copying these sources into the live directory as shown above.,

I have added a dns entry named betasite1.websiteexample.com that points to the iis server.
I have added another virtual ip address for the server to use for this site.

IP Address 192.168.1.3
TCP Port 80
Host Header Value : betasite1.websiteexample.com

Directory of files: C:\Websites\betasite

the issue I am having is that when I try to go to the website url Http://betasite1.websiteexample.com it says

Bad Request (Invalid Hostname)

On going to the actual iis server and right clicking the beta site and selecting Browse it says

The webpage cannot be found. HTTP 400

Any ideas what the issue can be?
ASKER CERTIFIED SOLUTION
Avatar of becraig
becraig
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Also this might just be an issue with the browser that a simply restart might resolve
What IP address did you put in DNS for betasite1.websiteexample.com? My guess is that you used 192.168.1.2, but it needs to be 192.168.1.3.

You can use different IPs, or host headers, but you normally wouldn't use different IPs AND host headers to disambiguate web servers. It seems to me that your production site is bound to an IP and host header, which means that anything that doesn't match the host header on that IP address will get an error. You would normally bind the "default" site to the one IP or any IP and NOT use host headers, and then bind additional sites to any IP and the specific host header(s).

Here's what I recommend

IP Address Any
 TCP Port 80
 Host Header Value : none
 Directory of files: C:\Websites\livesite

IP Address Any
 TCP Port 80
 Host Header Value : betasite1.websiteexample.com
 Directory of files: C:\Websites\betasite
Avatar of GenieMaster
GenieMaster

ASKER

The server is already hosting 2 websites.
Site 1 is running on 192.168.1.1
Site 2 (www.websiteexample.com ) is running on the virtual ip 192.168.1.2
Then this new beta site I am trying to get it to run on the virtual ip 192.168.1.3

The reason why we are using multiple ip addresses is because of an SSL requirement to site 1 and site 2.
From my understanding only 1 SSL certificate can be binded to 1 ip. So site 1 has an SSL and so does site 2.

At present the site 1 dns is pointing to a public ip address of 89.1.1.69
site 2 www.websiteexample.com  dns is pointing to a public ip address of 89.1.1.72
site 3 betasite1.websiteexample.com dns is pointing to the same public ip address of 89.1.1.72  (same as site 2)

The above public ip addresses resolve back to the iis server that is hosting the websites.

Am I doing this all wrong?
In your last post you have specified 3 different internal IP addresses, but only two public IP addresses. If this a problem from internal users, external users, or both?

What I am seeing is that external users for betasite1.websiteexample.com are being pointed to 89.1.1.72, which maps to 192.168.1.2, but you have bound betasite1.websiteexample.com to 192.168.1.3.

What you have listed for bindings is incomplete if you are also using SSL, since port 443 isn't listed in the bindings you have posted. If the betasite1 isn't using SSL, you can host it on the same IP as www.websiteexample.com. You can host multiple web sites if your SSL certificate is a wildcard or a SAN certificate that matches the FQDN of all websites that it needs to protect.

From what you have provided, if the beta site needs SSL you should use a new public IP that is translated to 192.168.1.3, or if you don't need https you can bind it to 192.168.1.2 and use host headers to serve up the proper site.

If you have only site per IP, I recommend that you stop trying to use host headers in your bindings and just reply on the IP address.
I am not sure what your network is like and if it allows hostname mappings but that could resolve your issue.

Based on your Network device config, you are sending traffic to the device which already has a mapping for HTTP and HTTPS traffic to go to the public site (site 2).

In order for site 3 to get traffic from the public IP you need to be able to create a mapping to send traffic based on host header request to the other private ip (if your network guys cannot make this mod)

Why not just test your site internally and use host files / internal DNS for now.