# Forwarded Headers

Middleware that restores the real client IP and scheme behind a proxy.

## What is **Forwarded Headers**?

Behind a proxy or load balancer, the **forwarded headers** middleware reads `X-Forwarded-For` and `X-Forwarded-Proto` so the app sees the real client IP and that the request was HTTPS.

```csharp
app.UseForwardedHeaders(new ForwardedHeadersOptions
{
    ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
});
```

Level: Freelancer · [More ASP.NET Core terms at this level](https://www.ask-codey.com/glossary?category=aspnet-core&level=4)

Updated: September 27, 2026

Source: https://www.ask-codey.com/glossary/forwarded-headers
