Reactjs – Deploying ASP.NET Core 2.1 React App on IIS server

asp.netasp.net-coreiisreactjs

I am trying to host a default React Application over my local IIS system.

Configurations are as follows

  • Visual studio 2017
  • IIS 10
  • 64 bit operating system
  • ASP.NET CORE 2.1

I've installed pre-requisites i.e. asp.net core 2.1 hosting bundle and runtime.

When I published application its directory are as follows

enter image description here

And hosting configuration I made:

  • created a new application pool with No managed code
  • Used this pool to host the web site

But when I run the application on browser it is showing 404 error, It is not finding the application.

However, with ASP.NET CORE 2.0 it is working with the same configurations.

Is this ASP.NET CORE 2.1 removed support for such applications ?

I've been through all possible forums and none of them mentioned how to host 2.1 application with React-Redux template.

Please help

Best Answer

I think I found the problem. It is something https enable configuration comes with default project of ASP.NET CORE 2.1.

When I hosted it on IIS server it was redirecting it to https url but IIS was not configured for IIS protocol.

For my needs I removed HTTPS redirection from Configure Method of StartUp.cs file

Removed app.UseHttpsRedirection()

It was now redirecting to HTTP

Related Topic