error_page 400 404 405 =200 @40*_json; location @40*_json { default_type application/json; return 200 '{"errcode":"404", "errmsg": "Hi guy,the API you are visiting does not exist, please check the URL and parameters."}'; } error_page 500 502 503 504 =200 @50*_json; location @50*_json { default_type application/json; return 200 '{"errcode":"1", "errmsg": "Server internal error, please contact the developer"}'; }
error_page 500 502 503 504 /50x.html; location = /50x.html { root html/; }