Legacy Knowledge Base
Published Sep. 10, 2025

Troubleshooting CORS Errors Breaking Images, CSS, JavaScript, SVG Icons, and Backend Features with a CDN

Written By

Daniel Martinez Cisneros

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • After setting up a CDN for static resources, buttons and other dynamic features stop working and fail to load, including JavaScript, CSS, and images. 
  • Browser console displays Cross-Origin Resource Sharing (CORS) errors when trying to access CDN resources:

    Access to XMLHttpRequest at '...' from origin '...' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
    

Environment

  • Liferay DXP 7.4 and Quarterly Releases
  • A CDN serving static resources from a non-portal domain (e.g., Akamai) 

Resolution

  • The CORS exception is caused by the CDN not including the Access-Control-Allow-Origin header with the domain serving the resources.
  • This should be handled by:
    1. Setting Up CORS, plus
    2. Configuring your CDN appropriately. Include the domain serving the portal in the CDN's CORS settings to prevent CORS blocks within browsers.

If resources still fail to load after these changes, check the browser console for more information about requests to the CDN domain that are still blocked.

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base