How does replica know which canister to serve from

I think using localhost subdomains might be breaking update calls in development: Fail to verify certificate in development update calls