Has anyone experienced errors with CloudFlare workers causing other URLs on the same hostname that don’t go to the worker also having the same error?
I have setup a CloudFlare worker as a reverse-proxy to return content from an origin server.
This worker is restricted to only work on a specific file-path, both using the worker route, and by the code in the worker checking the file-path of the request.
If the call to the origin server fails, then the call to the reverse-proxy worker on CloudFlare also fails with a HTTP error code of 526.
This is expected behavior, and not the problem. The problem is that if the reverse-proxy call fails with a 526 error, then the very next call to CloudFlare, regardless of file-path, will also fail with a 526 error. If I reload the URL again it will complete successfully, until I call the reverse-proxy worker and it returns a 526 error again.
Here’s an example of the problem (with fake URLs):
- www.mydomain.org is setup in CloudFlare DNS, with Proxy enabled.
- I setup a reverse-proxy worker assigned to the route DOMAIN FOR SALE
- The reverse-proxy worker is calling an origin server with the wrong SSL certificate.
- There are no other workers or routes that match the other calls I make.
The problem can be reproduced with the following steps:
- Call https://www.mydomain.org/reverse-proxy/ - this will result in the 526 error.
- Call https://www.mydomain.org/ - this will also results in a 526 error the first time it is called.
- Reload the URL from #2 as many times as you want and it will load successfully.
- Until you reload the URL from #1 and get the 526 again, at which point any URL will return a 526 error once.
Why would the call to the reverse-proxy failing result in all other calls to CloudFlare to fail?
I can fix the error in step #1 by installing the correct SSL certificate in the origin server, but I want my setup to be robust enough so the whole website is not brought down because the reverse-proxy is failing.