Fixing client domain routing issues in AEM as a Cloud Service
Client domain routing in Adobe Experience Manager as a Cloud Service (AEMaaCS) fails when dispatcher farms are misconfigured, causing requests to default to the wrong farm. To resolve this, validate dispatcher setup, update virtual host aliases, rename farm files to fix ordering, review client headers, and verify CDN settings for correct domain mapping.
Description description
Environment
Adobe Experience Manager as a Cloud Service (AEMaaCS) – Sites, production environment using Akamai CDN with domain certificates and multiple custom domains.
Issue/Symptoms
- Dispatcher logs display warnings such as: No farm matches host ‘localhost’, selected last farm ‘publishfarm’.
- The dispatcher configuration appears to prioritize enabled farms in reverse alphabetical order.
- Symlinks for files within the
enabled_vhosts
andenabled_farms
directories are missing. - Certain required server aliases such as
localhost
,127.0.0.1
are absent from the virtual host configuration.
Resolution resolution
To resolve this issue, follow these steps:
-
Validate Dispatcher Configuration:
- Use the Dispatcher validation tool locally to identify any errors or warnings in the current configuration.
- Ensure that all files within the
enabled_vhosts
andenabled_farms
directories are symlinks.
-
Update Virtual Host Configuration: Confirm that virtual host entries include all necessary server aliases:
ServerAlias "*example.com" "*.local" "localhost" "127.0.0.1" "*.adobeaemcloud.net" "*.adobeaemcloud.com"
-
Rename Enabled Farms: Remove numeric prefixes (for example,
00_
,01_
) from enabled farm filenames, as these may cause reverse alphabetical ordering issues during farm selection. -
Enable Debug Logging: Set dispatcher logs to debug mode and capture log snippets related to farm selection or error occurrences for further analysis.
-
Review Client Header Rules: Inspect client header rules (For example,
clientheaders.any
anddefault_clientheaders.any
) for hardcoded placeholder values such as'localhost'
. Replace these with appropriate mappings for incoming requests. -
Test Changes Locally: Deploy the updated configuration on a local Dispatcher instance and validate functionality before applying changes to production.
-
Deploy Updated Configuration: Once validated, deploy the updated Dispatcher configuration using your pipeline tools.
-
Verify CDN Settings:
- Ensure that the CDN is correctly configured to use customer domain names.
- Validate that the X-Forwarded-Host header is set appropriately and does not contain placeholder values like
'localhost'
.
-
Re-Test Domain Routing: After deployment, test each custom domain to confirm that requests are routed correctly to their respective farms.
-
Monitor Logs Post Deployment: Continue monitoring Dispatcher logs after deployment to identify any anomalies or recurring issues.