Troy Crowe
Troy Crowe

Reputation: 123

Asp.net Core 2.0 always receives 404 once deployed

I have an ASP.Net Core API that works great while running in Visual Studio. I am able to perform all actions successfully. However, now that I have deployed it to a Win 2008 R2 server, using IIS as reverse proxy, no page resolves. I always get a 404 page not found error. Actually, if I add a default get method returning value array, like what is provided by default when creating a new controller, it always returns. I do not understand what the issue is.

Upvotes: 1

Views: 350

Answers (1)

KYG
KYG

Reputation: 684

With the given information, I suspect only one thing, is that your server is not allowing HTTP Methods, or at least the OPTIONS one(for the preflight request).

To remediate to that, check out the UrlScan.ini config file in your server located at the below path:

C:\Windows\System32\inetsrv\urlscan

Open the file, and go to [AllowVerbs] section, it should be as the following(Add OPTIONS if it's not there):

[AllowVerbs]

;
; The verbs (aka HTTP methods) listed here are those commonly
; processed by a typical IIS server.
;
; Note that these entries are effective if "UseAllowVerbs=1"
; is set in the [Options] section above.
;

GET
HEAD
POST
OPTIONS

Hope you'll find this useful

Upvotes: 1

Related Questions