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:

  1. Review the CDN configuration for the affected domain.

  2. Locate the Origin Request Policy associated with the relevant CloudFront distribution and cache behavior.

  3. Update or create the Origin Request Policy with 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.
  4. Apply the updated Origin Request Policy to the default behavior for the relevant CloudFront distribution.

  5. Save and deploy the CDN changes.

  6. 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.

recommendation-more-help
experience-cloud-kcs-help-kbarticles