Setting a custom json 503 error page in nginx with proper http and content-type headers
When running nginx as the front-end web service for your API, you may need to put up a "maintenance" page and send back "HTTP 503 Service Unavailable" for all incoming HTTP requests. For some reason, all the existing docs I found online were either too complicated or did not handle this properly. Here is a simple configuration block that will set the HTTP header, content type, and return a custom JSON file as the response.
continue reading...