It appears that the error_page directive is ignored when a status code is returned in the server context.
My nginx config: enter image description here
MyResult
I expect to return to error_page.
not return
return 200 '{"status":"sucess","result":"hello 200!"}';