I have a web application running on IIS 7 on Windows Server 2008 R2 (Datacenter edition) and built using Visual Studio 2010. When I deploy the website project to my local IIS server or the production IIS server hosted on a hosting service's VPS, the API Controller can be accessed via /api/notifications/
, which is done via an AJAX call from a webpage. The problem is, on an identical setup on the Amazon EC2 instance, none of the API Controllers work, they all result in a 404 not found response. I checked that the same version of the .NET framework is installed everywhere, that IIS is running the same handler mappings, modules, ISAPI filters, Request Filtering, and ASP settings are all identical. Ran failed request tracing on the EC2 instance and got no asp related errors. Everything is up to date. I tried adding:
<modules runAllManagedModulesForAllRequests="true" />
and also tried adding:
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*"
type="System.Web.Handlers.TransferRequestHandler" resourceType="Unspecified"
requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
To the appropriate places in the web.config file and still no api controllers. Normally, the website gets deployed to the "wwwroot" folder and everything else works, so I also tried deploying to a virtual directory by creating an application and accessing /Test/api/notifications/
still results in a 404 (while I can access the rest of the site at /Test/
).
I tried re-registering the framework via this post: http://www.aheil.de/2012/11/05/fixing-asp-net-mvc-4-web-api-404/
I made sure that "Allow unlisted file name extensions" was checked in the IIS config.
Any ideas why this isn't working on the EC2 instance?