Hey there. So I’ve already reviewed the Github issue [here ], which has been closed2 years ago since Cloudflare apparently made updates at that time, but I’m still unable to publish through Gutenberg (integrated within wordpress latest version) and I’m getting the error that Cloudflare is blocking Rest API apparently.
From the developper console I get this:
- {code: “rest_cookie_invalid_nonce”, message: “Le nonce du cookie n’est pas valide”,…}
- code: “rest_cookie_invalid_nonce”
- data: {status: 403}
- message: “Le nonce du cookie n’est pas valide”
Apparently the nonce key is being cached on the frontend beyond its lifespan, I need to hook into the API request before the authentication step and replace the cached nonce key with a valid one, but how do I do this? I am not skilled in that matter.
I also disabled the two rules: WP0025a and WP0025B. I’ve already disabled them prior, but I still can’t save a draft or whatever through Wordpress. I have purged all everything after each change at WAF or firewall rule level.
I have read also different tickets here, as well related to gutenberg (github) or stackoverflow. I tested many different tips but none worked.
I also added WP_DEBUG and display but no log file from the infinite loop to save the draft.
The root cause starts from this script (throught developper panel):
api-fetch.min.js within wp-includes/js/dist
wordpress 5.4.1
No cache plugin
No protection plugin
I have these bypass rules on:
WP0003 Wordpress - Bypass WAF for /wp-admin Cloudflare WordPress On
WP0004 Wordpress - Bypass WAF for /wp-admin/post.php Cloudflare WordPress On
Same problem on chrome or mozilla firefox.
If you need additional information, let me know.
Help welcome. I am stuck past 30 hours on this issue.
One last attempt is: using the plugin disable Gutenberg. And returning to old editing page.
It works back to normal. However I fear any similar conflict in the future.
Apparently there is a REST API Cloudflare url. Maybe that would help me to provide me some guidance. I would like to test with Gutenberg on.
Like on this article, I can’t whitelabel my IP as it changes very often, and I use Cloudflare pro plan.