Hi there, I’m seeing some weirdness in my configuration for my service.
I have a pinned service map that has a domain configured map.foo.com
in the service. Everything works until I start trying multiple different domains. I’m seeing that the first domain that’s loaded is the one that’s cached, and all the other sites get that cached content.
I’ve pinpointed it to being an issue with caching and my VCL snippet used from the documentation (and modified with my changes for my service). How can I make sure the cache isn’t causing a bleedover between my sites?
Here’s my vcl_pass / vcl_miss snippet for reference:
##################################
# Add Host Overriding and shielding fix
if (req.backend.is_shield) {
set bereq.http.host = "map.foo.com";
set bereq.http.host_preserve = fastly_info.host_header;
}
if (req.backend.is_origin) {
declare local var.existing_host STRING;
set var.existing_host = header.get(req, "host_preserve");
set bereq.http.host = if (
var.existing_host,
var.existing_host,
fastly_info.host_header
);
# If the host is in the dictionary, we replace it.
if (table.contains(hosts, var.existing_host)) {
set bereq.http.host = table.lookup(hosts, var.existing_host);
set bereq.http.x-forwarded-host = var.existing_host;
}
}
# End Host Overriding
Thank you in advance!