Litespeed cache problem

Hello there,

I get this error when I try to obtain a domain key for LiteSpeed Cache plugin in WordPress.
There was a problem with retrieving your Domain Key. Please click the Waiting for Approval button to retry.

There are two reasons why we might not be able to communicate with your domain::

  1. The POST callback to failed.
  1. Our Current Online Server IPs was not whitelisted.

Please verify that your other plugins are not blocking REST API calls, whitelist our server IPs, or contact your server admin for assistance.

Also when i try this url : I get the following error: {“code”:“rest_forbidden”,“message”:“Sorry, you are not allowed to do that.”,“data”:{“status”:401}}

May I ask if you are using a Free or Pro plan?
I wonder if the WordPress REST API could be disabled by some of the Manged WAF Rules, but I doubt if so.

Furthermore, as it’s stated, check your plugins if they are blocking any of the REST API calls - did you checked that?
Disabled all of them, therefore re-check if you get the JSON error 401 or not?

Can you ask them to provide you with them or find the IPs somewhere?
Here are the IPs which I would allow/bypass (whitelist at Cloudflare):

Therefore, I would suggest adding them to the both a Firewall Rule and IP Access Rule (just in case).

I would also allow/bypass your own server IP (just in case due to WP-cron, etc.).

Is the HTTP request POST method actually allowed to execute, even for that URL under /wp-json/?

You might also need to allow Cloudflare to connect to your origin host/server.
Furthermore, kindly re-check if Cloudflare is allowed to connect to your origin host to as follows in the below article:

Cloudflare IP addresses list can be found here:

Nevertheless, I would make sure I have configured to return the correct visitor IP using below step-by-step instructions:

Whitelist litespeed ip in cloudflare

How can I do that?

Before doing this make sure you pause cloudflare and check if that helps then unpause then only move on

To create an IP Access Rule, follow these steps:

Log in to your Cloudflare account.
Select your domain.
Click the Firewall app.
Click on the Tools tab.
Under IP Access Rules, enter the following details:
Enter the Value as an IP, IP range, or two-letter country code.
Select an Action.
Select whether the rule applies to This website or All websites in the account.
(Optional) add a Note (i.e. Payment Gateway).
Click Add.

1 Like

Also whitelist in your server

Also having the same issue with cyberpanel + cloudlfare. seems to be blocked somehow not sure why. Whitelisted al the ips. But cant even acces the url so, also disabled the firewall on my hosting etc. but nothing seemed to solve it

@user297 That’s actually from server and not cloudflare

1 Like

By some security plugin for WordPress?

Nope disabled all the plugins already and it did not help unfortunately

as @cloudcreatr stated, it comming from your origin host / server.

When I do curl -I -XPOST, it return me this:

Normally, I am an visitor - and not logged-in user, so I could expect this at least from my point of understanding:

HTTP/2 401
date: Fri, 03 Dec 2021 23:09:08 GMT
content-type: application/json; charset=UTF-8
x-robots-tag: noindex
link: <>; rel=""
x-content-type-options: nosniff
access-control-expose-headers: X-WP-Total, X-WP-TotalPages, Link
access-control-allow-headers: Authorization, X-WP-Nonce, Content-Disposition, Content-MD5, Content-Type
x-litespeed-tag: fc6_HTTP.401
x-litespeed-cache-control: no-cache
vary: Accept-Encoding
cf-cache-status: DYNAMIC
expect-ct: max-age=604800, report-uri=""
report-to: {"endpoints":[{"url":"https:\/\/\/report\/v3?s=vUqtWErMnU8jN3zzHpdO2YmzCNGhvdh9zV0Jn8uBiNbketcAsSJhWvuQRMiVZItCg2otk%2BK09KDXCqpYMv4Rnue%2B2hGSsZJy9U707PfinvGOeb3U53yV1BlaJyyE2iSiiWw%3D"}],"group":"cf-nel","max_age":604800}
nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
server: cloudflare
cf-ray: 6b8075ecbb025cb0-FRA
alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400, h3-28=":443"; ma=86400, h3-27=":443"; ma=86400

So, hm… at the end, does it mean it works only when you temporary enable the Development Mode at Cloudflare, or temporary enable the Pause Cloudflare for this site option, or even temporary switch from :orange: to :grey:?

Before doing this, may I ask you to check if you see some events in Firewall Events log at Cloudflare dashboard for your domain name?

Have you tried writing a ticket to

There seems to be issues as well for other users:

@user297 and @sachinnanayakkara.7 , in terms of this:

the issue here is CloudFlare proxy that alters the incoming IP so make it fail to authenticate

May I ask have you implemented as follows below to return the IP visitor on your origin host / server? (already mentioned in my first post at this topic):

Therefore, brings up endpoints at least.

I turn off cloudflare proxy and it’s worked. But when I turn on proxy that problem start again. How can I fix this?

Okay i fixed it, without having to disable cloudflare add all these ips to cloudflare firewall and to your openlite speed server Show Real Visitor IP Instead of CloudFlare IPs • OpenLiteSpeed with this guide. Then restart the ls server and it works.

1 Like

I am happy to hear this for your case! :wink:

@sachinnanayakkara.7 May I ask do you see some requests in Firewall Events at Cloudflare dashboard for your domain name?

Nevertheless, have you looked and implemented as follows here?:

As it seems the @user297 managed to make it work with it.
How about you?

How to whitelist ips on cloudflare? ( I already added them to IP Access Rules and waiting for results )

Good you have added them to IP Access Rules.

The other way is as @cloudcreatr mentioned here:

Furthermore, you might also need to configure your origin host/server/hosting to return the true visitor IP address using the above links “Show Real Visitor IP instead of Cloudflare IPs - OpenLiteSpeed”.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.