Share via

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

mc 6,801 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

Developer technologies | ASP.NET | ASP.NET Core
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 83,501 Reputation points Volunteer Moderator
    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' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.