How to Forward HTTPS headers Print

  • 0

Our GreenStack platform offloads SSL / HTTPS connections at the loadbalancer, this means that your site won't see the HTTPS connection by default.

Simply add the below code to your Program.cs file to make your website see the HTTPS headers:

builder.Services.Configure(options =>
{
    options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
    options.RequireHeaderSymmetry = false;
    options.KnownIPNetworks.Clear();
    options.KnownProxies.Clear();
});

app.UseForwardedHeaders();

Was this answer helpful?

« Back