# 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. 
# There is not set X-Yandex-NotFound-Project, to allow 404.yandex.ru decide, what will be shown to users. 
# Beware, 404.yandex.ru can: 
#   - show common 404 page with banners and direct. 
#   - show common 404 page with banners, direct and advice to user like "Probably you want to go to http://someproject.yandex.tld ?"
#   - just return 301 for some project. For this moment user will see blank page in this case.

# Read documentation, please - http://wiki.yandex-team.ru/morda/404

# This config should be used for unhandled by nginx configuration hosts. For example: 
# server { 
# listen [::]:80 default; 
# include locations/404-portal-default; 
# return 404;
# }

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