There are a bunch of contradictory statements about web.config and .NET Core.
This may be incorrect feel free to correct me but the way I understand it.
web.config was used to give some information to the hosting software like IIS some configuration details to help run the app correctly.
In dotnet core You have a layer between the hosting software like IIS and your Web App, and it's called Kestrel.
Kestrel is a proxy between the two. And the default web.config that you see, if you peek inside you will see default code which basically says, i'm a dotnet core app use the dotnet core runtime to run me. You can still put config there to tell IIS how to work, I specifically used it to increase the file upload size and windows authentication.
I would configure HTTP Headers using the middle ware.