How to stop Cloudflare returning an error page for 1XX status codes (on a specific URI)

I have a PHP script that returns some text and with a specified status code, eg. status.php?s=100 will return a 100 status code.

This works fine locally, but when I push and try to get a 100 status code for example, I get a custom Cloudflare page with a 520: ’ Web server is returning an unknown error’.

Anyone know how to disable Cloudflare / stop this for one specific URI? I tried with Page Rules but couldn’t get anything working.

Can you be more specific about what you’re trying to achieve, not technically, but overall?

If you look at this article, it explains how Cloudflare handles 1xx status codes and why…

I am getting this error 520 for at least one week and it is inconsistent, Most of the time it is not working but sometime the error goes away, I have spoken to my host provider globat and they can’t help on this. Unfortunately this seems to be a Cloudflare issue that needs to be sorted out sooner than later otherwise people using this service will leave.

Sorry I don’t have any idea on what needs to be done to fix this issue. Whether it is a paid service or not, the issue seems to be the same.

Regards,
Dan

I need to load a JavaScript file that is returned via a 100 HTTP status code. It’s a long story why, but I can share if you want. Sorry for the late reply.

I know why I’m getting the error, it’s because I’m returning a 100 HTTP response status code. I’m doing this intentionally and want to get the content of it instead of a Cloudflare error page.

I’m sorry, but as far as I’m aware, it’s not possible. There’s the “Custom Page” section to handle certain status codes, but nothing for the 1xx ones. It may be possible to do something with Workers, but I’m not sure.

Is it just the origin server that needs to return 100, or do you need to return it all the way through to the client?

For now I’m using a separate server and subdomain that doesn’t go through Cloudflare, and it works. It’s a bit slow though but it’s fine. Thanks for your help though!

1 Like

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