Logging the real client IP in IIS behind Akamai

Behind the Akamai edge, IIS logs an Akamai server instead of your visitor. Akamai gives you two headers to fix that, they are not equally trustworthy, and the more authoritative-looking one is the one that can be renamed or forged.

Short answer. Akamai sends X-Forwarded-For to your origin by default. True-Client-IP is off unless somebody turned it on: it is the Send True Client IP Header option inside the Origin Server behavior in Property Manager. Neither changes the IIS c-ip field, which is filled from the TCP connection and therefore records the Akamai edge server. Getting the visitor into c-ip needs something in IIS that reads the header and rewrites the field, validating it against the addresses Akamai actually connects from.

Check first: which header are you actually getting?

Do not assume. The two headers behave differently and only one of them is on by default.

Header Default Contents
X-Forwarded-For On The usual comma-separated chain. Akamai passes it through and appends rather than replacing it, so an inbound value that arrived with the request survives to your origin.
True-Client-IP Off by default A single address, added only when Send True Client IP Header is enabled in the Origin Server behavior. The name is configurable, so it may not be called this on your property.

The quickest way to settle it is to look, rather than to read the property configuration. Add both as custom log fields on the site temporarily, or capture request headers with Failed Request Tracing, and make one request through the Akamai hostname. If you go down the custom-field route, read the custom field troubleshooting guide first, because the log file name changes underneath you and that trips up almost everybody.

True-Client-IP looks more trustworthy than it is

This is the part worth slowing down for, because the intuition runs the wrong way. A single clean address looks authoritative next to a comma-separated chain of unknown provenance. In practice the chain is the one you can validate and the single value is the one you have to take on faith.

Three things follow from Akamai's own Property Manager documentation:

None of this makes True-Client-IP useless. It makes it conditional: trustworthy when the client-set toggle is off and your origin cannot be reached except through Akamai. Both halves matter, and the second one is the half people forget.

The half everyone forgets: origin reachability

Every header-based approach rests on the same assumption, that requests reaching IIS came through Akamai. If your origin also answers on its public address, anyone can connect to it directly with an X-Forwarded-For or True-Client-IP header of their choosing, and nothing downstream can tell the difference.

Akamai's answer to this is Site Shield, which its documentation describes as leveraging "a defined set of IP subnet ranges to route traffic to the origin", so that once those ranges are allowlisted at the perimeter it "helps prevent attackers from bypassing cloud-based defenses and directly targeting the application origin". Akamai also offers Site Shield Stable CIDRs, using larger and more static blocks so the firewall ACL needs updating less often.

Whether or not you use Site Shield, the same two addresses lists do the work: the firewall decides who may connect, and the trust list in IIS decides whose forwarded header to believe. Keep them consistent.

Why IIS logs the Akamai edge and not your visitor

The c-ip field in an IIS W3C log is taken from the TCP connection. Behind Akamai the only connection IIS ever sees is the one an Akamai edge server opened, so c-ip records Akamai. The visitor's address is present on the very same request, sitting in a header, but no version of IIS reads it. Not IIS 7, not IIS 8.5, not IIS 10 on Windows Server 2025. The background is in X-Forwarded-For and IIS.

The native IIS custom log field will put the header into your logs as an extra column, and it is worth knowing about, but it leaves c-ip untouched. Everything that already reads c-ip, which is most SIEM content, geo-IP reporting and audit tooling, carries on seeing an Akamai address.

The fix: X-Forwarded-For for IIS

Winfrasoft X-Forwarded-For for IIS is an ISAPI web filter that reads the header Akamai sends and writes the real client address into the standard IIS c-ip field. Same log file, same W3C schema, same column your collector already parses, now containing the visitor rather than the edge server. No application changes and no second log file.

Step by step

  1. Confirm which header is arriving, per the check above. If your property has Send True Client IP Header off, you are working with X-Forwarded-For, which is the portable choice anyway.
  2. If True-Client-IP is enabled, check the True Client IP Header Name field for a custom name, and check whether Allow Clients To Set True Client IP Header is on. If it is on and you did not intend it, that is a property change to make before you rely on the value.
  3. Install the filter on the IIS servers behind the edge and set the header name to match what is actually arriving.
  4. Populate the Proxy Trust List with the addresses Akamai connects to your origin from. If you have Site Shield, that is the map you were given. The filter walks the chain from the right, skips the hops you trust, and logs the first address that is not one of yours.
  5. Close the origin to everything else at the firewall, so the header cannot be supplied by someone connecting directly.
  6. Make a request through the Akamai hostname and confirm c-ip now holds the client address.

If Akamai is not the only hop

Plenty of estates run Akamai in front of something else, an on-premises load balancer or a WAF, and then IIS. That is fine, and it is exactly the case the chain exists for: each hop appends the address it received the connection from, so X-Forwarded-For arrives with several entries. Add every internal hop to the trust list, not just the outermost. Miss one and the filter stops walking at your own load balancer and logs that instead. The ordering is worked through in the header reference.

Frequently asked questions

Which header does Akamai send for the client IP?

X-Forwarded-For by default, and True-Client-IP only if the Send True Client IP Header option has been enabled in the Origin Server behavior in Property Manager. Akamai originated the True-Client-IP convention and Cloudflare also emits it on Enterprise plans. If both headers arrive they should agree, and X-Forwarded-For remains the portable choice.

Is True-Client-IP more reliable than X-Forwarded-For?

Not inherently, and often less so. It holds a single address with no chain, so there is nothing to validate against a trust list, the header name is configurable and may have been changed on your property, and a separate toggle controls whether a client-supplied value is passed through and accepted. X-Forwarded-For gives you every hop, which is what lets you decide which entry to believe.

Can True-Client-IP be spoofed?

It can, in two circumstances. If Allow Clients To Set True Client IP Header is enabled on the property, a caller can send the header and have it reach your origin. And if your origin is reachable without going through Akamai at all, anyone can connect directly and send whatever they like. Closing the second case is what Site Shield and origin firewall rules are for.

Why does c-ip show an Akamai address in my IIS logs?

Because c-ip is filled from the TCP connection and the only connection IIS sees is the one the Akamai edge server opened. The visitor's address arrives in a header on the same request, but IIS has never read forwarding headers natively in any version, so nothing joins the two together.

Which addresses go in the Proxy Trust List for Akamai?

The addresses Akamai actually connects to your origin from, plus every internal hop between the edge and IIS. If you use Site Shield you already have that set as a defined list of IP CIDR ranges, which is the same list your perimeter firewall should be allowing. Internal load balancers and WAFs count as hops and need to be included, otherwise the chain walk stops at your own equipment.

Can I just add True-Client-IP as an IIS custom log field?

You can, on IIS 8.5 and later, and it costs nothing. It gives you an extra column holding the raw header and leaves c-ip unchanged, so anything already reading c-ip still sees Akamai. It also makes IIS start writing log files with _x appended to the name, which can quietly break a log collector matching the old pattern.

Get X-Forwarded-For for IIS

Log the real client IP in the standard IIS c-ip field behind Akamai, with a Proxy Trust List so the value is validated rather than merely copied. IIS 10 on Windows Server 2016–2025, with a free 14-day trial.

View the product   or request a download →