Added ability to pick upstream based on subdomain.