Wp-corn.php 403 Error only when CF proxy is on

Hi,

Since I added domain to CF (CloudFlare), and activated CF Proxy, I keep getting this kind of error:

“POST /wp-cron.php?doing_wp_cron=1618321116.3875970840454101562500 HTTP/1.1” 403 - “https://test.coral.rs/wp-cron.php?doing_wp_cron=1618321116.3875970840454101562500” “WordPress/5.6.2; https://test.coral.rs

As you can see wp-cron.php respond with 403, which is not the case when CF proxy is off.
Since then I have tried numerous solution: disabling all WP (WordPress) plugins, setting up default WP .htaccess file and whitelisting CF IP addresses.

Also, the specified call occurs only when accessing the site. It is not related to the wp-cron schedule, which takes place at a certain time.

Website is hosted on VPS instance with VestaCP panel. Doubting that some configuration on the server might be causing this problem, I made a copy of the website to different server (bare metal server), with cPanel environment, but this solution also did not helped.

I guess the problem is somewhere in WordPress itself, but I have a hard time finding it.

Any proposed solution from this community would be of great help.

Thank you in advance.

Miloš

If it’s blocked by Cloudflare, it should show up on the Firewall tab under Overview’s Events log.

2 Likes

Hi sdayman,
Thank you for your response.
Sadly, there is nothing in Firewall Events that is related to mentioned problem.

I found the root of problem.

Some of developers has added this line in wp-config.php, and I don’t know why. -_-

if (basename(_SERVER['PHP_SELF']) === 'wp-cron.php' && (_SERVER[‘SERVER_ADDR’] !== $_SERVER[‘REMOTE_ADDR’])) {
header(‘HTTP/1.0 403 Forbidden’);
exit;

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