Some times you might need to return static response from nginx. for example validating file upload limit
location @413_xml {
default_type "text/xml; charset=UTF-8";
return 413 '<?xml version="1.0" encoding="UTF-8"?><result><status><interfaceId>cabinet.file.insert</interfaceId><systemStatus>NG</systemStatus><message>Image size Error(Capacity)</message><requestId>$request_id</requestId><requests/></status><cabinetFileInsertResult><resultCode>3008</resultCode></cabinetFileInsertResult></result>';
}