After a few more hours of digging, I think I was finally able to resolve the issue and now when I'm accessing / I get status 200. Respectively this can be changed to any path. Here is the code that I made it working with:
app.Use(async (context, next) =>
{
if (context.Request.Path == "/")
{
context.Response.StatusCode = 200;
return;
}
await next();
});