How to host a asp .net core application under a sub folder

后端 未结 3 820
北荒
北荒 2021-02-08 05:32

I have a asp .net core app running on Linux using Kestrel.

It binds to the ip ok on port 80.

But the nginx reverse proxy site needs to host the app under a non-r

3条回答
  •  我在风中等你
    2021-02-08 06:21

    ScottC,

    Once your web content is under wwwroot you have to add app.UseStaticFiles() on the configure section on Startup class.

    See the example below:

    public void Configure(IApplicationBuilder app, IHostingEnvironment env)
    {
        app.UseStaticFiles();
    }
    

    Hope to have helped you.

提交回复
热议问题