Gateway timeout when redirect in php is sent

Additional information

I don’t know/other

What is the error number?

504

What is the error message?

gateway time-out

What is the issue you’re encountering

timeout

What steps have you taken to resolve the issue?

the only way to stop this is bypass cloudflare. the webpages in question have run perfectly without cloudflare. i believe cloudflare is causing a loop,

What are the steps to reproduce the issue?

php script runs that has redirect:
$url = ‘web_page.php’;
header('Location: ’ . $url);

Screenshot of the error

cloudflare_ap_error.png

Sorry to see that this has been happening for you.

The 504 error here is happening at the origin, and so you would need to troubleshoot at the origin to see why it is giving this response. For some general advice on what you would be looking for you can find it here

Once you have that information you can then figure out what needs to be adjusted so the origin doesn’t return a 504.

thank you!!!
i finally figured out the problem. it happened when there was an email sent in php, the redirect was a confounding variable. because our server’s email address was set to example.com instead of mail.example.com, cloudflare and our server did not play well together

1 Like

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