Return JSON for 404 error instead of html

justink101 nginx-forum at nginx.us
Tue May 13 04:08:59 UTC 2014


How can I return a custom JSON body on 404, instead of the default html of:

<html>
    
    <head>
        <title>404 Not Found</title>
    </head>
    
    <body bgcolor="white">
        <center>
            <h1>404 Not Found</h1>
        </center>
        <hr>
        <center>nginx</center>
    </body>

</html>

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,250033,250033#msg-250033



More information about the nginx mailing list