Ok, I found the answer. The trick is that you must explicitly define error_page for all of these special locations. Here is the configuration that worked for me.
location / {
root /var/www/nginx-default;
index index.html index.htm;
error_page 404 /404.html;
}
location /abc1.html {
root /var/www/nginx-default;
error_page 404 /special_error.html;
}
location /abc2.html {
root /var/www/nginx-default;
error_page 404 /special_error2.html;
}
nginx, , , "location". , . ,
http:
http:
"" , . , - nginx . .