diff --git a/docker/fallback/default.conf b/docker/fallback/default.conf index a46c971..02897ae 100644 --- a/docker/fallback/default.conf +++ b/docker/fallback/default.conf @@ -3,6 +3,15 @@ server { root /usr/share/nginx/html; location / { + set $json 0; + if ($uri ~* "^/v1/") { set $json 1; } + if ($http_accept ~* "application/json") { set $json 1; } + + if ($json = 1) { + default_type application/json; + return 503 '{"error":"Service Unavailable","message":"EventHub is temporarily unavailable. Please try again later."}'; + } + return 503; }