# This config proxies 404 errors to any.yandex.ru 
# There is now interception of errors, so if your backend pushes to nginx his own content for 404 - it will be shown, not proxied page, if you are using this config. 
# 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 without backend (e.g. static files).

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;
}
