Hello everyone,
I'm trying to catch various types of errors on upstream and to show users the real cause of the problem (more detailed then showing only 503/504). I found interesting implementation of it at CloudFlare (https://support.cloudflare.com/hc/en-us/sections/200820298-Error-Pages):
Error 522: Connection timed out
Error 521: Web server is down
Error 520: Web server is returning an unknown error
Error 523: Origin is unreachable
Error 524: A timeout occurred
Error 525: SSL handshake failed
Error 526: Invalid SSL certificate
But I have no idea how to catch same errors and separate details via Openresty & Lua. Could anyone share some PoC or examples with me, please?
I would be grateful for any help on this matter.
Thanks,
Alex