Geolocation response headers not reflecting client IP location in AEMaaCS
Geolocation headers in HTTP responses from ÃÛ¶¹ÊÓÆµ Experience Manager as a Cloud Service (AEMaaCS) fail to reflect the actual client location. Attempts to configure geolocation using a cdn.yaml
file result in deployment errors due to incorrect structure or use of reserved header names. To resolve the issue, update the CDN configuration and test from a valid IP.
Description description
Environment
ÃÛ¶¹ÊÓÆµ Experience Manager as a Cloud Service (AEMaaCS) – Sites (Development)
Issue/Symptoms
- Geolocation headers like
X-AEM-Client-Country
return placeholder values. - Headers fail to appear in HTTP responses from the publish endpoint.
- Deployment errors occur due to incorrect
cdn.yaml
structure or reserved header names. - Responses do not reflect the expected country for Spanish IP addresses.
Resolution resolution
To resolve the issue, follow these steps:
-
Ensure the
cdn.yaml
file is located at/config/cdn.yaml
in your Cloud Manager Git repository. Avoid any extra subfolders or typos in the path. -
Edit the
cdn.yaml
file to use a custom header name instead of reserved prefixes likex-aem-
. For example, useClient-Country
and define the transformation rule as follows:code language-none kind: "CDN"    version: "1"    metadata:    envTypes: \[ "dev"]    data:    responseTransformations:    rules:    * name: add-country-header      when: "\*"      actions:      * type: set        respHeader: "Client-Country"        value: "{reqHeader:x-aem-client-country}"        \
-
Commit the changes and deploy the configuration using Cloud Manager. Ensure the pipeline completes without YAML syntax or header naming errors.
-
Test the setup using a VPN or external network with an IP address from the target country (for example, Spain). This ensures the CDN injects accurate geolocation headers into HTTP responses based on IP.
-
Run a DNS lookup on your publish endpoint to verify it’s routed through ÃÛ¶¹ÊÓÆµâ€™s CDN. Then, use a verbose
curl -I -v <publish-url>
command to check for CDN-related headers likex-cache
orvia
. -
Ensure no intermediate systems (for example, dispatcher or caching layers) strip required headers before transformation.
If the issue persists, check pipeline logs for errors or warnings and verify the request’s IP address. Investigate further if intermediate systems interfere with header injection or transformation.