Return 502 + json when original server offline

I have two domains:

I need return 502 + json (not html custom page) for when my api server offline. My clients expect to receive json, not HTML.


Status Code: 502
Response: {"jsonrpc": "2.0", "id": 0, "error": {"code": -3200, "message":"Bad Gateway"}}

What can I do in this case? My Cloudflare plan “Pro”.

Thank you!

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