diff --git a/content/src/SDApp.Web/Program.cs b/content/src/SDApp.Web/Program.cs index 33982e1..bdb1594 100644 --- a/content/src/SDApp.Web/Program.cs +++ b/content/src/SDApp.Web/Program.cs @@ -1,5 +1,6 @@ using GovUk.Frontend.AspNetCore; using Microsoft.AspNetCore.DataProtection; +using Microsoft.AspNetCore.HttpOverrides; using Prometheus; using SDApp.Web; using Serilog; @@ -64,8 +65,17 @@ options.CreateIfNotExists = true; }); +builder.Services.Configure(options => +{ + options.ForwardedHeaders = ForwardedHeaders.All; + options.KnownIPNetworks.Clear(); + options.KnownProxies.Clear(); +}); + var app = builder.Build(); +app.UseForwardedHeaders(); + app.UseSerilogRequestLogging(); if (app.Environment.IsDevelopment())