Return JSON for 404 error instead of html

Matthias Rieber ml-nginx at zu-con.org
Tue May 13 08:44:21 UTC 2014


On Mon, 12 May 2014, Lord Nynex wrote:

> Justink101,
>
> Using the echo module
>
> error_page 404 @404;
> location @404 { echo '{"status": "Not Found"}'; }

if your using proxy_pass, don't forget:

proxy_intercept_errors on;

Matthias



More information about the nginx mailing list