Skip to content
nsin docs

Proxy Headers

When a record is proxied, nsin adds HTTP headers to the request it sends your origin, and a few more to the response. Read them to recover the real visitor, their location, and a request id for troubleshooting.

All nsin headers use the Nsn-* prefix.

Headers added to the request (nsin → your origin)

Section titled “Headers added to the request (nsin → your origin)”
CategoryHeaderExampleMeaning
Visitor IPNsn-Connecting-IP203.0.113.10The real visitor’s IP. Use this to identify the client.
Visitor IPX-Forwarded-For203.0.113.10, 198.51.100.1Standard proxy chain; the visitor is the first entry.
Visitor IPX-Real-IP203.0.113.10The visitor IP (single value).
Visitor IPForwardedfor="203.0.113.10";host="...";proto=httpsRFC 7239 structured form.
Protocol & hostX-Forwarded-ProtohttpsProtocol the visitor used. Use it to enforce HTTPS / build absolute URLs.
Protocol & hostX-Forwarded-Hostapp.example.comThe hostname the visitor requested.
Protocol & hostX-Forwarded-Port443The port the visitor connected on.
GeolocationNsn-CountryNLTwo-letter ISO country code. XX when unknown.
GeolocationNsn-ContinentEUContinent code (AF, AS, EU, NA, OC, SA, AN). Omitted when unknown.
TracingNsn-Ray8e9c123456789abcUnique request id. Log it to correlate a request across systems.
TracingNsn-EdgeEDGESThe nsin PoP (edge) that handled the request.
TracingCDN-LoopnsinLoop-prevention marker (RFC 8586). A request that re-enters the nsin edge already carrying nsin is rejected — don’t point your origin back at nsin.

Prefer Nsn-Connecting-IP: unlike the X-Forwarded-* family, another proxy in front of your origin can’t overwrite it with its own value.

The upstream Host header is the visitor’s requested hostname (e.g. api.example.com for a wildcard record, not *), unless you set a Host Header Override on the record.

Geolocation is best-effort and network-dependent. No city, region, postal code, coordinates, or timezone.

Headers added to the response (nsin → visitor)

Section titled “Headers added to the response (nsin → visitor)”
HeaderExampleMeaning
Nsn-Ray8e9c123456789abcSame request id as above, returned to the visitor for support/debugging.
Nsn-EdgeEDGESThe nsin PoP that served the request.
Nsn-Cache-StatusHITHow the cache handled the request.
Nsn-Cache-RuledefaultPresent when the request was handled by nsin’s default static caching rather than one of your cache rules; Nsn-Cache-Status still says whether it was a HIT, MISS or BYPASS.
ServerNSINIdentifies the nsin edge.

Nsn-Cache-Status values:

ValueMeaning
HITServed from the nsin cache; your origin was not contacted.
MISSNot in cache; fetched from your origin (and may now be cached).
BYPASSCache deliberately skipped (e.g. cookies, authorization, or a cache rule).
DYNAMICNot cacheable — served straight from origin.

Point your framework or reverse proxy at the connecting-IP header. nginx:

real_ip_header Nsn-Connecting-IP;
# set_real_ip_from <nsin edge IPs>; # only trust the header from nsin

See also Domain Modes for proxied vs. DNS-only records, and Security Headers for the optional response headers you can enable per domain.