Versions

Drupal: 8.2.6
CDN: 8.x-3.0

Steps for reproduction

  • Set up your Drupal 8 installation to be served by cdn, allow cdn url in "trusted_host_patterns"
  • use simple mapping and set serve to "all files".
  • set "Make files cacheable forever"

Try to edit an arbitrary file.

You may get errors like
"NetworkError: 403 Forbidden - https://s.example.com/cdn/farfuture/bVoDYzwMwjp3oL94u8doKIHU66BY8LLCh_wk..."

where example.com is domain served by cdn url specified above.

Comments

ip6li created an issue. See original summary.

wim leers’s picture

Category: Bug report » Support request
Status: Active » Postponed (maintainer needs more info)

Does this happen for all files? Or just for CKEditor language files?

wim leers’s picture

Title: 403 Forbidden if "Serve all files" is selected » CKEditor translation JS files cannot be loaded (403) when using Interface Translation + "Serve all files" + "Forever cacheable files"
Status: Postponed (maintainer needs more info) » Fixed
Related issues: +#2827638: "Forever cacheable files" enabled + "CSS aggregation" disabled via settings.local.php = files referenced from CSS files 403'ing => don't alter CSS file URLs in this case, +#2827998: Add a new default option to the CDN UI: "all files except CSS+JS", and make this the new default of the CDN module, include upgrade path

Reproduced. This only happens for CKEditor, when:

  1. the Interface Translation module is installed
  2. you're using a language other than English
  3. you have the CDN module configured to Serve all files, and not the default of Serve all files except CSS+JS
  4. you have the CDN module's Forever cacheable files setting enabled

The CDN configuration:

langcode: nl
status: true
mapping:
  type: simple
  domain: cdn
  conditions: {  }
farfuture:
  status: true

You can fix it by either:

  1. disabling Forever cacheable files or
  2. choosing Serve all files except CSS+JS instead of Serve all files

This is essentially the same problem as #2827638: "Forever cacheable files" enabled + "CSS aggregation" disabled via settings.local.php = files referenced from CSS files 403'ing => don't alter CSS file URLs in this case. The only solution is #2827998: Add a new default option to the CDN UI: "all files except CSS+JS", and make this the new default of the CDN module, include upgrade path.


Also note that if you want your CKEditor dialogs to work correctly, you'll need to choose Serve all files except CSS+JS anyway, due to a long-existing bug in Drupal core: #2811615: [upstream] [Core bug, fixed since 9.5] AJAX commands that need additional JS to be loaded will fail when JS is loaded from CDN.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

wim leers’s picture