Gateway timeout (error 504) when email is sent in php

What is the name of the domain?

private

What is the error number?

504

What is the error message?

gateway time-out

What is the issue you’re encountering

timeout. i wonder if cloudflare is creating a loop when an email is sent in php? our htacess has a redirect turning all http to https. i wonder if cloudflare is doing this too and creating a loop. how do i get cloudflare to stop doing that?

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?

email sent in php

Screenshot of the error

cloudflare_ap_error.png

Did you do this? :point_down:

Keep to one thread, it saves wasting peoples’ time.

tried that, did not work.
also tried page rules - always use https - did not work.
also tried page rule: www.website.com/email

Disable Security, Cache Level: Bypass, Disable Apps, Disable Performance
did not work

If you give the website/link you are having trouble with it is easier to check for the redirects.

the website is bypassed from cloudflare at this time as we cannot run it when it does not work right

is there a way i can send you the website privately?

You can put it in here and post the first digits of the ID so I can find it…
https://cf.sjr.org.uk/tools/check

check?d676029959a84ae99fdc8284

Make sure your mail subdomain is set to DNS only. Although Cloudflare will automatically work round it, you will probably also want to set your MX record to point to mail.example.com as well as it is currently set to example.com which will be proxied when you enable it. Cloudflare will publish an MX record starting _dc-mx to work round this, but you may prefer to see the MX record as set.

1 Like

thanks for all your help!!!
unfortunately i had already tried with the mail subdomain set to dns only and it still had problems.

i do not know if this helps, but we do have another website running on the same server (and same settings) that works in cloudlfare.
i did your tool check and here is the beginning of the id: check?4e302fa4af8744ffb68d9

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

This topic was automatically closed after 15 days. New replies are no longer allowed.