This changed in Kong 0.10 with the introduction of the load balancer. Setting ngx.var.upstream_host in the access phase of a plugin should work, since it is considered right before the load balancing phase, see:
If this does not work for you, could you be more specific, and give us:
The version of Kong on which you are seeing this behaviour
A more detailed description of what your plugin does, and where (or ideally, if you can, the relevant snippet of code)
An example request, along with the Service/Route configuration - this would help us understanding any other issue that may occur, such as your plugin not executing for example…
BTW, in Kong 0.14.0 (of which we just released the first RC), we introduced a Plugin Development Kit, which offers formalized, documented, and forward-compatible Lua functions to do this kind of things (setting/retrieving headers, etc…). You can read more about it in the 0.14.0 Changelog, and expect detailed documentation very soon.