Knowledge Base
Published Aug. 3, 2026

CKEditor 5 Icons Not Loading When CDN is Enabled

Written By

András Bakalár

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.

Issue

  • When a Content Delivery Network (CDN) is configured using the cdn.host.http and cdn.host.https properties in the portal-ext.properties file, the icons in the CKEditor 5 toolbar fail to load in Web Content articles.
  • The browser's developer console may show errors related to Cross-Origin Resource Sharing (CORS) policy, indicating that the browser is blocking requests to load SVG icon assets from the CDN's domain.

Environment

  • Liferay 2026.Q1+

Resolution

The issue is caused by the browser's security policy preventing cross-origin requests for SVG spritemaps, which CKEditor 5 uses for its icons. When the portal is on one domain and the CDN is on another, the browser blocks the request unless the CDN is configured to allow it.

There are two primary architectural models for using a CDN with Liferay DXP:

  • Model 1: CDN as a Reverse Proxy (Transparent)
    • The site's DNS points to the CDN, and the CDN proxies all requests to the Liferay DXP instance. From the browser's perspective, all resources are served from the same domain.
    • This model does not require cdn.host.* properties and avoids CORS issues.
  • Model 2: CDN as a Separate Origin (Explicit)
    • The site's DNS points directly to the Liferay DXP instance. The cdn.host.* properties are used to rewrite static asset URLs to point to the CDN domain.
    • This is the model that causes the cross-origin issue.

To resolve this, choose one of these solutions:

1. Configure CORS on the CDN (Recommended for Model 2)

  • If you are using the separate origin model, you must configure your CDN (e.g., Amazon CloudFront) to include the correct CORS headers in its responses. This tells the browser that it is safe to load resources from the CDN domain.
  • The CDN should send an Access-Control-Allow-Origin header that includes your Liferay portal's domain. For example:
    • Access-Control-Allow-Origin: https://your-portal-domain.com
  • Configure the CDN behavior to allow GET, HEAD, and OPTIONS HTTP methods, as OPTIONS is required for CORS preflight requests.

2. Switch to the Reverse Proxy Model (Recommended for New Setups)

  • Reconfigure your architecture to use the CDN as a transparent reverse proxy (Model 1). In this setup:
    1. Point your site's public DNS record to the CDN.
    2. Configure the CDN to forward requests to your Liferay DXP instance as its origin.
    3. Remove the cdn.host.http and cdn.host.https properties from your portal-ext.properties file.
  • This approach simplifies the configuration and avoids cross-origin issues. Because the browser sees every resource coming from the same domain, it makes no cross-origin requests.

Additional Information

Did this article resolve your issue ?

Knowledge Base