I'm trying to setup the monitor pages on a VMWare NSX load balancer. The issue is that we are pointing at 2 IIS nodes that are using host header binding and the Service Monitor can't access the monitor pages.
I have configured an F5 load balancer to do the same thing and we were able to specify a send string that contains the host name so it new which website to point at but I can't seem to get the NSX load balancer to send the host name with the request.
Anyone know how to do this?
SOLVED
I ended up figuring it out myself. There is a way for you to pass the Host header information with the NSX load balancer service monitors.
The NSX Service Monitor config is as follows:
Type: HTTPS
Expected: 200
Method: GET
URL: /monitor.html HTTP/1.1\r\nHost:bla.yourcompany.com
I've been doing some more research on this and it's covered in the VMware documentation for 6.3, but it applies to previous versions. I also found that adding it via the URL didn't work with a http 1.0 web server.
https://communities.vmware.com/docs/DOC-31772
From slide 15, you can add the host name to the http header adding the following line to the extension box.
header="Host: app1.xyz.com"
Related
I am new to configuring apache webserver(this is my first time) and over the last few days i have been trying to configure apache so as to view the default page over the internet.I have been successful partially in being able to view the default page over local host on the network. The problem really comes over when I try to view the page over the public ip of the server.Every time i try the page reports a time out and/or an error in connection, so I have increased the time out from 300 to 3000(the issue remains). I have searched extensively over the internet and based on the findings i have configured apache to grant all connections, i have also configured the firewall on my linux system to allow incoming & outgoing. Further I have configured my dad's huawei hotspot e55** series as mentioned in the link here https://portforward.com/huawei/ . I have also tried to configure my internet connection for port forward from external to the internal ip however what i observe is that after i do that my internet connection seems to get disabled and I would have to delete the connection and add another one.At this point it looks like that I might be missing out something here and I believe a little help from the apache experts might just help me achieve my goal to view the default apache web page over the web using the system (public)ip(using whatismyip on google search).
I think the public ip provided by your ISP cannot be used for hosting the website on the internet please contact your ISP to get a public IP that can host websites over the internet , or get a cloud hosting server.
I have tried to send a DNS packet to get an IP of some web-site.
In some cases, like google, the IP was right and when i typed it in the url line it sent me to google.
But in other cases (for example : stackoverflow.com) its gave me an IP that didin't linked to the web-site.
To be sure that my packet is right, i tried to do Nslookap in the command line, and the result was the same.
So i cant find the right IP adress of a web-site.
There is the message that appear when I'm trying to enter stakoverflow
Fastly error: unknown domain: 151.101.65.69.
Please check that this domain has been added to a service.
You (generally speaking) can not open the website just by entering the IP address in your browser's address bar because web servers (and possibly many other network components that are between you and the web server) often do not host only one web site on that IP address so they rely on exact domain name typed in address bar to serve the right content.
I think, it's caused by yours internet restriction. Try to contact your ISP (your internet provider) about this problem. He will probably know more about cause of this problem.
Short answer: you need a host header.
Long answer: Since HTTP/1.1 introduced in 1997 (and then updated in 1999 and in 2014), the request needs a host header. That allows the web server to route a request to a corresponding server configuration, a virtual server in Apache speak. Some servers don't have this configured and is allowing requests to any host to be served from the same web server configuration.
HTTP/1.1 also allowed multi-tenant proxies, as Fastly, to exist in the Internet. Fastly is a CDN - content delivery network - that allows to cache websites content on closer to users and deliver it locally (faster than from a cloud or a colo, thus the name).
When you're not specifying the domain for the request, it looks like your client (or a library) is using the IP address as the host header. That's why the response from Fastly talks about domain: unknown domain: 151.101.65.69.
While Fastly do support service pinning to a dedicated IP address, which would have worked for your request - it doesn't look like stackoverflow is using the feature as they might not need it.
we have two VM (classic) in an availability set and via end points defined load balancer on port 80.
Each VM has 5 websites running and the load balancer distributes calls between server 1 and server 2
When I call one of the websites, e.g. www.mysite.com is it possible somehow to identify which server has served the request?
Is it possible to force load balancer to ping a specific server? This can be super useful when we deploy a new version of the website e.g. on Server 1 and we want to test does it work on Server 1
thanks
I would include an header "Server :" in my response : rfc2616-sec14.. Then you are able to check it via Chrome Developer Tools (Network) or any other similar tool.
At the end, I've figured out how this can be done. Hopefully, my answer will be useful to someone with a similar problem
-Identifying servers, as ArneRie has suggested, can be done by adding a custom HTTP header response - https://technet.microsoft.com/en-us/library/cc753133(v=ws.10).aspx
Call specific server
In the Azure portal create a new endpoint, e.g. 802 ->8181.
RDC to the server open port 8181
Install port forwarding utility https://sourceforge.net/projects/pjs-passport/
Set a new rule: all traffic coming from 8181 should be redirected to 80 (as the source port use internal server IP)
Call www.mysite.com:802 and it will be served from the specific server
Repeat steps 1-4 with another server just use a different port e.g. 801, 803...
We're writing an ASP.NET 5 (vNext) application that partly includes geocoding the user's location based on their IP address. We're attempting to grab the client's IP address using the following code found from a number of examples across the web:
var connection = context.HttpContext.GetFeature<IHttpConnectionFeature>();
if (connection != null) {
clientIpAddress = connection.RemoteIpAddress.ToString();
}
When we log the clientIpAddress that comes from the IHttpConnectionFeature, we find that the IP address is not correct.
However, we do notice that IIS is capturing the correct client IP address. We see this by inspecting the requests via the IIS control panel.
So, somewhere between the IIS request and our application code, the client's IP address is being modified, or our application code is not working properly with IIS. Or is it possible that IIS is performing extra work in deciphering the client's IP address - work that we need to mimic in our application code.
Why is the client's IP address correct in the IIS request logs, but not correct in our application code above? How do we grab the correct client IP address in our code?
Relevant software versions:
ASP.NET 5 (vNext)
KRE 1.0.0-beta2
IIS 8
Update: We ran a .NET 4.5 application on the same IIS server that retrieves the IP address using Request.UserHostAddress and it also retrieved the correct IP (the same one IIS is logging), so it seems to be an issue with the new .NET 5 code.
This was due to a bug in the Microsoft.AspNet.Loader.IIS package. Luckily, the guys at Microsoft speedily posted a fix.
For more context, see the Github issue: https://github.com/aspnet/HttpAbstractions/issues/181
When using host headers to host multiple websites on the same IP address in IIS, is there any way of accessing that website from a browser running on the local machine?
This is normally required when a given web component only allows configuration from the local machine. It's also useful when things like ASP.Net's built in error handling isn't working and you can only view the error in the browser but don't want to allow remote users to see it.
This has baffled me for a while and everytime I come across it I end up giving up in frustration and reconfigure stuff so I can accomplish such tasks remotely.
Added: #Ishmaeel - modifying hosts doesn't seem to help - you either get a 400 error (if all websites have host headers) or whichever site is configured without a host header.
Just an idea: Mapping the hostname to 127.0.0.1 in the hosts ($WINDOWS$\system32\drivers\etc) file may help. This way you should be able to pull up the local IIS site by typing the hostname as if it's a remote server
Maybe I am not understanding the question, but what's wrong with just typing in the URL for the website? If it's the matter of domain name resolution, you can point to the right DNS or put it in hosts file.
eed3si9n -- if you are trying to access a url locally and you use host headers you cant just type in the url: for example you have 2 websites (website1.com website2.com) on 1 server using host headers. the local ip of the web server is 192.168.1.50 --> if you type in 192.168.1.50 you will get a 'page cannot found'. if you put in the url website1.com or website2.com you will be accessing the sites from the outside (not locally).
so the problem is how to access the sites locally not from the outside -- for example i need this ability so that i can access locally as the test sites are only available locally. not from the outside...
You can try telnetting to the server.
$ telnet localhost 80
(type these lines manually)
GET / HTTP/1.1
Host: www.example.com
(exchange www.example.com for the host name your server is mapped to)
I would assume the only way you can do this is assigning a custom port to the specific website you want to monitor and just access it as "localhost:CustomPort".