Compares Nginx, IIS with the ASP.NET Core Module, YARP, Azure Front Door, Application Gateway (and Application Gateway for Containers), Azure Load Balancer and API Management by layer, scope and job, and how to choose a minimal layered edge for a .NET API in Azure.
They overlap, but each has a home. Azure Front Door is a global layer-7 edge: anycast entry points, WAF, CDN caching and failover between regions. Application Gateway is a regional layer-7 load balancer inside your VNet with WAF v2 and path routing; Application Gateway for Containers is its AKS flavour. API Management is an API product layer: subscription keys, quotas, policies, versioning and a developer portal. Nginx and IIS are self-hosted proxies on VMs (IIS hosts ASP.NET Core through the ASP.NET Core Module). YARP is a proxy library you run as a .NET app when routing needs C# logic.
I decide by job: global edge and WAF, regional private routing, API productisation, custom routing. One component per job. The trade-off is that every extra layer adds latency, cost and another set of timeouts to keep in step.
"I sort these by layer and scope. Front Door is global: users hit the nearest Microsoft edge point of presence over anycast, it terminates TLS, runs WAF rules, can cache static content, and routes to origins in one or more regions, so it gives me failover between Australia East and Australia Southeast. Application Gateway is regional and lives in my VNet: it's a layer-7 load balancer with path-based routing, WAF v2 and private backends, and in AKS the newer Application Gateway for Containers plays the ingress role. Azure Load Balancer is layer 4 only, so it knows TCP ports, not URLs.
API Management is a different kind of thing. It's about treating APIs as products: subscription keys, quotas, JWT validation policies, transformation, versioning and a developer portal. It can route, but I don't use it as my load balancer. Nginx and IIS are what you run yourself on VMs; IIS is still common in Australian enterprise and government for Windows hosting, and it runs ASP.NET Core through the ASP.NET Core Module, in-process by default. YARP is a library: I build a .NET app that is a proxy, which is great when routing needs real logic in C#. On Kubernetes the community ingress-nginx controller was retired in March 2026, so new clusters should use a Gateway API implementation instead.
The mistake I see is stacking everything: Front Door, then Application Gateway, then API Management, then an Nginx ingress, then YARP, each terminating TLS and each with its own timeout. That's five hops to debug. For a typical public API I'd pick Front Door with WAF straight to Container Apps, add API Management only if partners consume the API, and add YARP only if routing needs code. Fewer layers, each with a clear job."
| Component | Layer | Scope | Main job | Hosting |
|---|---|---|---|---|
| Azure Front Door | L7 | Global | Edge TLS, WAF, CDN, multi-region failover | Managed |
| Application Gateway | L7 | Regional, in VNet | Private L7 load balancing, WAF v2, path routing | Managed |
| App Gateway for Containers | L7 | Regional, AKS | Kubernetes ingress / Gateway API | Managed |
| Azure Load Balancer | L4 | Regional | TCP/UDP distribution | Managed |
| Traffic Manager | DNS | Global | DNS-based failover | Managed |
| API Management | L7 | Regional or multi-region | API products, keys, quotas, policies, portal | Managed |
| Nginx | L7 | Wherever you run it | Proxy, TLS, routing, caching | Self-hosted |
| IIS + ASP.NET Core Module | L7 | Windows server | Host and proxy ASP.NET Core on Windows | Self-hosted |
| YARP | L7 | Wherever you run it | Custom routing logic in C# | Self-hosted .NET app |
| System | Edge layout |
|---|---|
| Public SaaS API on Container Apps | Front Door (WAF) → Container Apps ingress |
| Partner API products | Front Door → API Management → services |
| Private line-of-business app | Application Gateway (WAF v2) in VNet → App Service with private endpoint |
| AKS microservices | Front Door → Gateway API implementation → services |
| Legacy Windows estate | IIS on VMs behind Application Gateway |
A public API had Front Door → Application Gateway → API Management → Nginx ingress → services, with TLS terminated four times and p50 overhead of about [35 ms] before the app ran. Removing Application Gateway (Front Door already had WAF) and the Nginx ingress (Container Apps ingress replaced it) cut edge overhead to about [12 ms] and halved the number of certificates to renew.
Checks that the candidate can place each proxy and gateway by layer and scope and can design a minimal edge instead of stacking products.
Green flags
Red flags
DNS (Traffic Manager) ← picks an endpoint by DNS answer
│
User ──▶ Front Door POP (global anycast, L7) ← TLS, WAF, cache, origin failover
│ private link or public origin
Application Gateway (regional, L7) ← VNet, WAF v2, path routing
│
API Management (API layer) ← keys, quotas, policies
│
Ingress / YARP / Nginx ← in-cluster or in-app routing
│
Kestrel
You rarely need every row. Each row is optional; choose rows by the jobs you need done.
Front Door's anycast IPs are announced from Microsoft points of presence worldwide, including Sydney and Melbourne. TLS is terminated close to the user, then traffic rides Microsoft's backbone to the origin. Because it is global, it can route away from a failed region. Application Gateway is deployed into a subnet in one region; for Australia East and Southeast resilience you run one per region and put Front Door or Traffic Manager in front.
API Management executes a policy pipeline per call (inbound, backend, outbound, on-error), written in XML policies with C# expressions. It is built for API governance: products, subscriptions, rate limits per key, JWT validation, transformation, mocking and analytics. It can load balance across backend pools, but it does not replace WAF or global failover, and its per-call overhead is higher than a plain proxy.
On Windows, IIS runs ASP.NET Core through the ASP.NET Core Module (ANCM). In-process (default since 3.0): the app runs inside w3wp.exe using IISHttpServer, no Kestrel hop. Out-of-process: IIS proxies to a Kestrel process. Limits come from IIS (maxAllowedContentLength, 30,000,000 bytes by default) as well as the app.
The community ingress-nginx controller stopped receiving releases and security fixes in March 2026. New AKS clusters should use a Gateway API implementation (Application Gateway for Containers, Istio, Envoy Gateway and others). Annotations from ingress-nginx do not carry over; they must be expressed as HTTPRoute rules and policies.
YARP is a toolkit, not a product: no portal, no WAF, no managed scaling. It wins where routing needs code (tenant-aware routing, strangler-fig migration, BFF token handling) and where a .NET team wants to debug the proxy with the same tools as the app.
AzureDiagnostics / FrontDoorAccessLog) to measure time spent before the request reaches the app.HTTPRoute that replaces an ingress-nginx rewrite annotation.Locking the app to one edge: accept traffic only from your Front Door profile and trust its forwarded headers.
// Program.cs (.NET 10)
using Microsoft.AspNetCore.HttpOverrides;
var builder = WebApplication.CreateBuilder(args);
var frontDoorId = builder.Configuration["Edge:FrontDoorId"]
?? throw new InvalidOperationException("Edge:FrontDoorId is required");
builder.Services.Configure<ForwardedHeadersOptions>(o =>
{
o.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
// Container Apps ingress is the immediate hop; trust its range from config.
foreach (var cidr in builder.Configuration.GetSection("Edge:TrustedNetworks").Get<string[]>() ?? [])
o.KnownIPNetworks.Add(System.Net.IPNetwork.Parse(cidr));
});
var app = builder.Build();
app.UseForwardedHeaders();
// Reject anything that did not come through *our* Front Door profile.
app.Use(async (ctx, next) =>
{
if (ctx.Request.Headers["X-Azure-FDID"] != frontDoorId)
{
ctx.Response.StatusCode = StatusCodes.Status403Forbidden;
return;
}
await next(ctx);
});
app.MapGet("/health/ready", () => Results.Ok());
app.Run();
A Gateway API route replacing an ingress-nginx rule in AKS:
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: orders
spec:
parentRefs:
- name: public-gateway
hostnames: ["api.example.com"]
rules:
- matches:
- path: { type: PathPrefix, value: /orders }
backendRefs:
- name: orders-api
port: 8080
X-Azure-FDID header plus the AzureFrontDoor.Backend service tag.The question I ask first is "what job is not done yet?" rather than "which gateway do we use?". Global users or multi-region DR means Front Door. Private-only traffic in a VNet means Application Gateway or internal ingress. External developers paying for or subscribing to APIs means API Management. Routing that needs code means YARP. If no job is unfilled, adding a component is cost without value. I also check data residency: Front Door processes requests at global edge locations, so for workloads that must keep traffic in Australia (some government and health systems), a regional Application Gateway in Australia East may be the safer edge.
| Option | When it fits | Cost | When not to |
|---|---|---|---|
| Front Door | Public, global or multi-region, WAF at edge | Base fee plus per request and data | Private-only systems; strict in-country processing |
| Application Gateway | Private or regional L7 in a VNet | Hourly plus capacity units | Global routing; you already have Front Door WAF |
| API Management | Partner or public API products | Tier based, Premium for multi-region | Internal service-to-service calls |
| YARP | Custom routing in C#, migrations, BFF | Your compute and ops time | A config rule in a managed service would do |
| Nginx / IIS | VM hosting, legacy estates | Patching and ops | PaaS hosting |
Measure overhead per hop with Front Door access logs (timeTaken vs origin time) and Application Insights end-to-end transactions.
An API gateway is a single entry point in front of your services that routes requests and applies cross-cutting concerns: TLS termination, token validation, rate limiting and quotas, request ids, IP filtering, header rewriting and sometimes caching. Azure API Management is a managed gateway with XML policies, products and subscriptions, a developer portal and analytics; YARP is a .NET reverse-proxy library you host yourself and extend in C#. A backend-for-frontend (BFF) is a gateway per client (web, mobile) that aggregates and shapes data for that client. The danger is a smart gateway: business rules and orchestration in policies become untested, hard-to-version logic owned by nobody. Keep the gateway thin and services authoritative.
Kestrel is the default, cross-platform server built into ASP.NET Core and is fine to run directly, which is what you do in containers and on Linux. On Windows with IIS, the ASP.NET Core Module (ANCM) connects IIS to your app in one of two ways: in-process (the default), where the app runs inside the IIS worker process w3wp.exe using IISHttpServer instead of Kestrel and is fastest on IIS; or out-of-process, where IIS reverse-proxies to Kestrel running in a separate dotnet process. HTTP.sys is a Windows-only, kernel-mode server for when you need Windows authentication, port sharing or kernel caching without IIS. The trade-off: Kestrel is portable and simple, IIS gives Windows process management, and HTTP.sys gives Windows features without IIS.
TLS encrypts and authenticates the connection; HTTPS is HTTP over TLS. In ASP.NET Core, UseHttpsRedirection redirects plain-HTTP requests to HTTPS, and UseHsts adds the Strict-Transport-Security header so the browser refuses to use HTTP for that host for max-age (30 days by default), closing the first-request downgrade window after the first visit. Preload goes further: the domain is baked into browsers, so even the first visit is HTTPS — but it requires a year-long max-age, includeSubDomains, and is slow to undo.
For APIs, don't depend on redirects: non-browser clients ignore HSTS and may already have sent a token over HTTP, so refuse HTTP instead. Behind a proxy, run UseForwardedHeaders first or the app thinks every request is HTTP and loops.
How to tell it (STAR)
**S:** At [company] our portal API had five layers in front of it and a pen test showed attackers could skip the WAF entirely. **T:** I was asked to [lead the remediation] and simplify the edge without downtime. **A:** I traced requests through each layer's logs and Application Insights, found duplicated WAF, four TLS terminations and a 20-second timeout behind a 60-second one causing the 502s. I locked the origin to our Front Door profile first, then removed Application Gateway and moved from ingress-nginx to Gateway API, keeping API Management only for partner traffic. **R:** Edge overhead fell from about [35 ms] to [12 ms], the unexplained 502s stopped, the re-test found no bypass, and we cut about [$X] a month from the Azure bill.
Last updated 23 Nov 2026.