How to add default page to asp.net core web in linux ?

mc 4,836 Reputation points
2021-06-23T03:09:53.86+00:00

I am using asp.net core web and linux.
the nginx.conf I add index index.html but it not work.

in razorpages I change the index to index.html
and I want to If one open the url can open the index.html.

http://www.xxxx.com

but now I have to enter the index.html

http://www.xxx.com/index.html

or there will be an 404 error

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,674 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 68,236 Reputation points
    2021-06-23T14:39:14.293+00:00

    As you want a static file to be the default, you need to config the default file handler. You want to configure default documents. See docs


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.