Only send requests from 1 IP address to second host

So I’m trying to roll out a new api server on new backend infrastsructure (heroku to aws).

I set up a fastly domain and added two hosts so that I can use the auto load balance feature to slowly steer traffic to my new backend. However, I’m running into an issue that I can’t figure out and can’t afford to send live production traffic to a backend that is erroring.

What I want to do is to send all traffic from my IP address to the new backend. This seems like it should be as easy as adding a condition, but I can’t get that to actually work. or at least, there’s nothing obvious hitting my new backend when this is set up.

I’ve tried three things. I’ve added a condition client.ip == "my.ip.add.ress"' and I've tried adding one with X-Forwarded-For == “my.ip.add.ress”’ and I’ve even tried creating an acl whitelist variable and tried 'client.ip ~ ip_whitelist || X-Forwarded-For ~ ip_whitelist`. None of those seem to be doing the trick.

Anyone have success routing traffic from a specific IP or set of IPs to a different host?

1 Like

RESOLVED!

The issue was that I had a global “don’t cache anything” VCL snippet inserted into vcl_recv that was “return(pass);” and that was inserted BEFORE the conditions, so they were never evaluated.

2 Likes

Awesome! Glad to hear you got this worked out :+1:t2:

If you have any other issues, then just let us know.

Thanks!

1 Like