When a website runs behind Cloudflare, parts of the backend panel can stop working. For example, the navigation menu stops responding after opening a page, list rows ignore hover and click events, or the page only starts working again after a popup is opened and closed. The symptoms can be hard to trace since no errors appear in the browser console. Cloudflare Rocket Loader rewrites script tags to defer their execution, which breaks the script loading order that the backend panel relies on.
Solution
The recommended solution is to install the Cloudflare plugin, which adds the data-cfasync="false" attribute to every backend script tag so Rocket Loader leaves them untouched. The plugin also registers the Cloudflare network as trusted proxies, so the HTTPS protocol and visitor IP address are detected correctly.
php artisan plugin:install RainLab.Cloudflare
Alternatively, you may disable Rocket Loader in the Cloudflare dashboard, either for the entire site or with a configuration rule that targets the backend path (/admin by default).
Tip: The plugin only protects the backend by default, so Rocket Loader can continue optimizing theme scripts. If your theme or the AJAX framework is affected on the frontend, set
CLOUDFLARE_IGNORE_FRONTEND_SCRIPTS=truein the.envfile.
Was this article helpful?