my solution was
if (!app.Environment.IsProduction()) { app.Use((context, next) => { context.Request.Scheme = "https"; return next(context); }); }