How nginx replaces external picture links that are referenced in a website that do not exist

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
    <h1>Test</h1>
    <img src="https://www.baidu.com/files/vender_pic/24115.png">
</div>
</body>
</html>

when https://www.baidu.com/files/vender_pic/24115.png does not exist, replace it with localhost/images/default.png ?

Mar.04,2021

has nothing to do with nginx and cannot do it. Just add an onerror event to img
as follows

function nofind(){ 
    var img=event.srcElement; 
    img.src="/images/default.png"; 
    img.onerror=null;  
} 
<img src="https://www.baidu.com/files/vender_pic/24115.png" onerror="nofind();" />
Menu