Frontend pipeline deployment breaks the website

This article describes a solution to the issue where frontend pipelines are not successfully applied to websites, even when deployment finishes successfully. Add ServerAlias to an enabled vhost to fix it.

Description description

Environment

AEM as a Cloud Service

Issue/Symptoms

Frontend pipelines are not successfully applied to websites. Although the deployment finishes successfully, the js/css files are not applied to the website.

Steps to reproduce

  1. Create a new site using the aem-site-template-standard version 2.2.0.
  2. Download sources from that site.
  3. Make some changes to the website theme.
  4. Push sources into the repo/branch.
  5. Run FE pipeline from that repo/branch.

After the FE pipeline is deployed, the new site breaks and no js/css is loaded.

In addition, you will see that at:

"/conf/fe-pipeline-test/sling:configs/com.adobe.cq.wcm.core.components.config.HtmlPageItemsConfig/jcr:content", the property "prefixPath" is set to:

"https://static-pxxxxx-eyyyyy.adobeaemcloud.com/5be94d5dbcc77e833330ed8d9d98f549f85aebfffd0ce933c04f9b1e6e67bdad", which looks good.

But whatever resource we try to load from this server (like the css: https://static-pxxxxx-eyyyyy.adobeaemcloud.com/5be94d5dbcc77e833330ed8d9d98f549f85aebfffd0ce933c04f9b1e6e67bdad/theme.css), we always get “It works”.

Resolution resolution

Based on the fact that when styling loads from the static domain, it only returns “It works”, we need to verify whether the static domain is not blocked at the dispatcher level.

For FE pipelines to work, the deployed frontend artifacts need to be served correctly by CDN/dispatcher.

If the static domain is blocked by the dispatcher configuration, the css/js cannot be loaded.

For this, at least one of the enabled vhosts has either:

ServerAlias *
OR
ServerAlias "static-p<progId>-e<envId>.adobeaemcloud.com"

On checking the customer’s dispatcher configuration, it could be seen that only the deault.vhost has ServerAlias "*". However, the default.vhost was not enabled.

Adding ServerAlias to an enabled vhost fixed the issue.

recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f