Cloudflare removes headers on errors

I have set all my servers to always add a header with the hostname with nginx. and it works even with errors.

However cloudflare does not pass the headers if a errors occurs, making difficult to know which server had issues.

Is there any settings or way to make cloudflare not remove my headers when there is errors 500, 504, 502?

Unfortunately, I don’t think Cloudflare returns one bit of information from the failed connection.

This really makes debugging issues a lot harder

Agreed. I think only Support can see the actual response. Possibly if they logged the Ray-ID, but more likely if they can reproduce the error.

In my case cloudflare connects to my own edge servers, which connects to my backend servers.

They all add their own headers so I can identify the chain used and the server with issues…but then cloudflare removes it all so I have to bypass it if I want to debug the error

1 Like

That should be pretty easy with a local hosts file. Still, though, it’s a bit of a hassle.

Enterprise customers can show the error page from their Origin, which will contain whatever data you want.


I’d buy enterprise if it was as easy as buying business

Are you familiar with the pricing structure?

you should be able to get the hostname to match error status served at CF edge end just by using Cloudflare’s Web Analytics if you’re on a paid plan. i.e.

filter on the error status code to narrow it down

I’m pretty sure it’s all the same hostname, like, but behind their edge server, they have and

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