# This config proxies 404 errors to any.yandex.ru 
# There are interception of fastcgi errors, be aware - it will intercept any errors, not only 404. 
# Also there are set X-Yandex-NotFound-Project=autodetect to show 404 page specially configure for project, if it has own X-Yandex-NotFound-Project ID. 
# Read documentation, please - http://wiki.yandex-team.ru/morda/404

# This config mostly can be used for any project with fastcgi backend. 

fastcgi_intercept_errors on;

error_page 404 @404portal;

location @404portal {
	 proxy_set_header X-Real-IP $remote_addr;
	 proxy_set_header Host $host;
	 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	 proxy_set_header X-Yandex-NotFound-Project "autodetect";
	 proxy_pass http://any.yandex.ru;
}

