You can conditionally rewrite the Host header in the vcl_recv section of your Varnish configuration. You will need a way to identify which URLs are for static content. Here is an example; the specific regular expressions will depend on how your site is structured.
sub vcl_recv {
# Normalize Host if URL is one of:
# /css/* /js/* /favicon*
if (req.http.Host ~ "^u-\w+\.example\.org$" &&
req.url ~ "^/(css/|js/|favicon)")
{
set req.http.Host = "u-xxxxxxxxx.example.org";
}
}
Your backend web server will see the rewritten Host, so make sure you normalize to a name that it recognizes.