diff --git a/Dockerfile b/Dockerfile
index 670c581..b17ad6b 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -30,6 +30,7 @@ COPY --from=build2 /src/Groceries/config.ini /config/
 
 RUN apk add --no-cache icu-libs tzdata
 
+ENV ASPNETCORE_FORWARDEDHEADERS_ENABLED=true
 ENV ASPNETCORE_HTTP_PORTS=80
 ENV DOTNET_ENABLEDIAGNOSTICS=0
 ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
diff --git a/Groceries/Program.cs b/Groceries/Program.cs
index f88a15e..f690b8e 100644
--- a/Groceries/Program.cs
+++ b/Groceries/Program.cs
@@ -1,7 +1,6 @@
 using DbUp;
 using Groceries.Data;
 using Microsoft.AspNetCore.DataProtection;
-using Microsoft.AspNetCore.HttpOverrides;
 using Microsoft.EntityFrameworkCore;
 
 var builder = WebApplication.CreateBuilder(args);
@@ -29,13 +28,6 @@ if (!dbUpgradeResult.Successful)
     return -1;
 }
 
-builder.Services.Configure<ForwardedHeadersOptions>(options =>
-{
-    options.ForwardedHeaders = ForwardedHeaders.All;
-    options.KnownNetworks.Clear();
-    options.KnownProxies.Clear();
-});
-
 var dataProtection = builder.Services.AddDataProtection();
 if (env.IsProduction())
 {
@@ -59,7 +51,6 @@ builder.Services.AddDbContextPool<AppDbContext>(options => options
 
 var app = builder.Build();
 
-app.UseForwardedHeaders();
 app.UseStaticFiles();
 app.UseRouting();
 app.UseSession();