Configuring signalR to work in IIS6 - iis

I'm working on a signalR project, and was running into HTTP 404 errors when deploying to a server running IIS6 (Windows Server 2003). The 404 was on the signalr/hubs reference. It was suggested in the JabbR chat room to add a wildcard map (* to aspnet_isapi) in IIS to resolve the issue. That did in fact resolve the 404 issue, but I began receiving the error "ASP.NET Ajax client-side framework failed to load".
If I take the wildcard off, the AJAX loads and functions as expected. I have to believe that this mapping is not the correct way to go; perhaps there is a handler that needs registered in the web.config file.
It's worth noting that the entire solution works perfectly on my local (Windows 7) development machine.

Related

HTTP Error 401.2 - Unauthorized with Error Code 0x80070005 with both IIS ans IIS Express

After attempting to configure IIS as a replacement for IIS Express, both stopped working and delivered the above error on deploying the .NET Core project in VS2019. According to IIS anonymous authentication is enabled, I also entered explicit user name and password as well as giving my user all rights to work with the project's directory. I restarted the IIS several times and re-created the pools and Pages, as well as repairing VS2019 in hope to get the IIS Express running again at least.
I have no idea what else I could do.
EDIT: I am using IIS10
Module
IIS Web Core
Notification
AuthenticateRequest
Handler
aspNetCore
Error Code
0x80070005
Requested URL
http://localhost:12345/
Physical Path
C:\inetpub\...
Logon Method
Noch unbestimmt
Logon User
Noch unbestimmt
You can try the following steps to solve your problem:
Right click on the project, go to properties.
Select the web, and then you will find a service setting
Change the project URL for other port, like http://localhost:44338/.
I was able to figure it out myself by now:
For some reason during setting up the IIS and IIS profile (accidentally or by some quirk of VS), the anynomous authentification setting was set to false. Which also affected the IIS Express to not work properly anymore. Simply enabled anonymous authentication resolved the issue for both.
Project Properties -> Debug -> IIS profile -> anonymous authentification: ✓

GET request to IIS returns Microsoft-HttpApi/2.0

I've got 6 identical machines running IIS and Apache. Today one of them decided to just stop serving requests. I can access all of the webapps when I try from localhost/resource but when I try from url/resource I get a 404. I did a Get request against the machine that isn't working and I get this back:
Server: Microsoft-HTTPAPI/2.0
Connection: close
Compared to a working server:
Server: Microsoft-IIS/8.5
X-Powered-By: ASP.NET
Content-Type: text/html
Tried searching for this problem but came up with nothing, anyone got any idea's?
Windows has an HTTP service that manages calls to IIS and other HTTP enabled services on a windows machine. Either you need to configure it to handle your calls, or, in the case of WAMP or similar non-IIS-web-server-on-windows scenarios you may just need to turn it off.
When you see "Microsoft-HttpApi/2.0" returning error, such as 400 "bad URL" or "bad header", etc. the problem is most likely because the HTTP.sys service is intercepting your http request and terminating it because it does not meet with the minimum validation rules that are configured.
This configuration is found in the registry at HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\HTTP\Parameters. In my case, it was choking because I had a RESTful call that had a 400 character segment in the url which was 160 characters more than the default value of 260, so I
added the registry parameter UrlSegmentMaxLength with a DWORD value of 512,
stopped the service using net stop http
started the service using net start http
I've run into these issues before and it is easy to troubleshoot but there is very little on the web that addresses it.
Try these links
"the underlying problem is that the client has sent a request to IIS that breaks one or more rules that HTTP.sys is enforcing"
enabling logging on HTTP.sys is described here
a list of the HTTP.sys parameters that you can control in the registry is found here.
A bit late, so put here for posterity ;-)
After trying all sorts of solutions found on the web, I almost gave up, but found this little nugget.
If the response's Server header returns Microsoft-HttpApi/2.0, it means that the HTTP.sys is being called, not IIS.
As a result, a lot of the workarounds will not work (URLScan, etc).
This worked however:
Open regedit
Navigate HKLM\SYSTEM\CurrentControlSet\Services\HTTP\Parameters\
If DisableServerHeader doesn't exist, create it (DWORD 32bit) and give it a value of 2. If it does exist, and the value isn't 2, set it to 2.
Finally, restart the service by calling net stop http then net start http
src: WS/WCF: Remove Server Header
Set below registry flag to: 2
HKLM\SYSTEM\CurrentControlSet\Services\HTTP\Parameters\DisableServerHeader
Setting this to 2 will ensure that self host WCF services no longer sends the SERVER header and thus ensure we are security compliant.
Please note that this disables ALL server headers.
The default value of 0 enables the header, and the value of 1 disables server header from DRIVER (http.sys), but app can still have headers.
For me I had to restart the server for the changes to take effect.
Hope this helps someone
I was working on our web app on a client's site and ran into an issue where the site root pages loaded, but the reports folder always returned a 404 for files that existed in the folder. The 404 page showed the .Net version of 2 when the application was set to 4, and a test of a non-existent page in the root returned a 404 page showing .Net 4.
I tried just http://localhost/reports and got back a Microsoft Reporting Services page. Not part of my application.
Be sure to check just the default document of the folder when a unexpected 404 comes up and the file exists.
This question and series of replies helped me get to the bottom of the related issue I was having. My issue centered around using just a subdomain to go to our server (e.g. typing "www/somepath" into the browser while on our corporate network), which had worked in the past on an older server, but no longer worked when the system was upgraded to a new server. I saw the unexpected Microsoft-HttpApi/2.0 string in the header when using the Chrome Devtools to inspect the Network traffic.
My HTTP.sys process was already logging, so I could verify that my traffic was going to that service and returning 404 NotFound status codes.
My resolution was to add a binding to the IIS site for the subdomain, making IIS respond instead of the HTTP.sys process, as described in this server fault article - https://serverfault.com/questions/479274/why-is-microsoft-httpapi-returning-404-to-my-network-switch
In my case, running Windows 10 Pro, it was the Windows MultiPoint Service.
By executing:
net stop wms
Port 80 was released.

Debugging ERR_CONNECTION_RESET error

Recently I started getting The connection was reset. error message (error code is ERR_CONNECTION_RESET) when I open one of my websites. This has nothing to do with application(node.js) level afaik as no changes or deploys were made in the application. To add to this, there were no error logs so I am assuming the request did not even receive the node app. The website is hosted on godaddy and its backend is a elastic beanstalk application. How do I fix this? On the web browser, in the second attempt it automatically loads correctly. But in a iframe which embeds my website, this has become a nasty issue as the browser does not even retry. I did the DNS analysis using dig command and all that but could not find anything relevant. Interesting part is this only happens after some interval (it does not happen continuously). On reload it works without fail.

IIS 404 Error even when file exists?

I have been working with IIS 7 for a while and it has worked fine until it just suddenly started throwing 404 errors for my multiple websites even though they actually exist. All of the configurations seems fine (path, default document) but not a single file, no matter the format or location will be loaded.
Another strange thing is that everything works when I try to access the websites via localhost or 127.0.0.1 but not through my external IP.
Does anyone know why this could happen and how I can fix it?
Edit:
It appears this 404 page is not the built in IIS error page. It is associated with nginx but I'm not sure where the file is located on my server or why my pages are being intercepted.
It turns at the server was hijacked by Morfeus F***ing Scanner, which I was not aware was even a thing until this happened. It's activity showed up in the server access logs. I basically had to reset the entire server. It was quite a chore.

ajax post in azure with ssl error

i have a web role with mvc 3 on azure with os 2 that is working fine - with ssl
I wanted to upgrade my project to mvc 4 with .net 4.5 so i created a new azure project and copy everything to a new project and everything worked on my station ( I have windows 8 with iis 8 like server 2012).
i upload the new project to azure - with os 3 and everything and my web site is working fine until the code need to create an ajax request with parameters - the ajax request is pending for a minute or so and then i get an error page.
when i remove the https to http the ajax request is working flawlessly.
after investigating and putting traceFailedRequests i saw that iis is rejecting those ajax request.
in the moudle ManagedPipelineHandler i get http reason of unauthorized.
I cant seems to figure what is happening in 2012 server - for now i downgrade the mvc4 to .net 4 and change back to server 2008 r2 and everything is working like a clock.
Does anyone got any idea what can be the problem?
thanks.

Resources