Yeah! Thanks, maybe you should add to the wiki, that "if" is executed before proxy_pass ;-)
Anyways, thank you very much for this helpful answer, it works this way.
obviously the map has to be the other way around, so if anyone finds this.. the correct way for caching only if upstream sets a custom header is:
map $upstream_http_myheader $nocache {
default 1;
1 0;
}
proxy_no_cache $nocache;