Return JSON for 404 error instead of html

B.R. reallfqq-nginx at yahoo.fr
Tue May 13 13:30:56 UTC 2014


>
> Instead of using 3rd-party echo module, you can utilize the return
> directive
> for the same purpose:
>
>   return 200 '{"status": "Not Found"}';
>
> Reference: http://nginx.org/r/return
>
>   wbr, Valentin V. Bartenev
>

​I would have intuitively written code 404 rather than 200 on this one
since the aim is to send a 404 error answer.​
Am I wrong? Would that loop?
​
---
*B. R.*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20140513/d88f8dbd/attachment.html>


More information about the nginx mailing list