AEM requests lose query parameters when a CloudFront origin policy doesn’t forward them
This article explains how to resolve an issue where URL query parameters stop working on an Adobe Experience Manager (AEM) site after a domain change, due to CDN configuration not forwarding query strings to the origin server.
Description description
Environment
- Adobe Experience Manager site
- Customer-managed CloudFront distribution or another CDN with an equivalent Origin Request Policy
- AEM origin server or AEM as a Cloud Service origin, when applicable
Issue/Symptoms
- After you launch a new domain or update an existing domain and CDN configuration, requests containing query parameters return errors such as missing required parameters.
- API endpoints or pages that rely on query strings don’t process the request correctly.
- The problem occurs for requests that contain query strings.
Cause
The CDN doesn’t forward query-string parameters to the AEM origin. AEM therefore doesn’t receive the values required to process the API request or page.
Resolution resolution
Follow the steps below to resolve the issue:
-
Review the CDN configuration for the affected domain.
-
Locate the
Origin Request Policyassociated with the relevant CloudFront distribution and cache behavior. -
Update or create the
Origin Request Policywith the following settings:- Query Strings: All
- Headers: None, unless your application requires specific headers at the origin.
- Cookies: None, unless your application requires specific cookies at the origin.
-
Apply the updated
Origin Request Policyto the default behavior for the relevant CloudFront distribution. -
Save and deploy the CDN changes.
-
Send requests with query parameters, such as
https://example.com/path?param=value, and verify that the expected response is returned and that the missing-parameter error is resolved.