ACL on Cloud Next: Self-Referential Outgoing Drupal HTTP Requests and Varnish
How It Works
When your Drupal app makes an outbound curl request to its own domain (e.g. calling its own REST API, JSON:API, or any self-referencing endpoint), the request flows like this:
Drupal PHP Process
→ outbound curl to https://mysite.com/api/endpoint
→ hits the load balancer
→ hits Varnish
→ Varnish checks client.ip against ACL
→ if IP not in allowlist → 403 Forbidden ❌
→ if IP in allowlist → passes through to PHP ✅The request is treated like any other external request — it goes out and comes back in through Varnish, not via localhost.
Common Scenarios Where This Matters
- Drupal calling its own JSON:API or REST endpoints
- Drush or cron jobs making HTTP requests to the site
- Acquia Purge module sending cache invalidation requests
- Any custom module using
\Drupal::httpClient()orcurlto call its own domain
The Fix
Make sure your Web EIP (Elastic IP) addresses are in the allowlist. Acquia actually calls this out specifically — on Cloud Next, purge requests come from Web EIP addresses and will be blocked if not allowlisted:
acl allowlist_mysite {
"203.0.113.10"; # Web EIP 1
"203.0.113.11"; # Web EIP 2
}You can find your Web EIP addresses in the Acquia Cloud UI under your environment's infrastructure details, or by asking Acquia Support.
Key Distinction
Request Type | Goes Through Varnish? | Needs to be in ACL? |
|---|---|---|
Outbound curl to own domain | ✅ Yes | ✅ Yes |
Internal | ❌ No | ❌ No |
Database calls | ❌ No | ❌ No |
So if you ever see mysterious 403s on self-referencing curl calls in your Drupal logs, a missing Web EIP in the Varnish ACL is the first place to look.
To get a machine IP address, we have a few options depending on what you need:
# Most common - shows all network interfaces and IPs ip addr show
# Shorter output ip a
# Just the main outbound IP (cleanest for scripting) hostname -I
# Old-school (may need net-tools installed) ifconfigOn Acquia Cloud Next specifically, to find your Web EIP (the public-facing IP Varnish sees):
# Shows the external IP as seen from outside curl ifconfig.me
# Or curl icanhazip.comThe curl ifconfig.me approach is most useful on Acquia because it shows the actual public IP that Varnish would see as client.ip — which is what needs to be in your ACL allowlist.
Recent content
-
4 hours 59 minutes ago
-
8 hours 58 minutes ago
-
1 day 1 hour ago
-
4 days 10 hours ago
-
1 week 1 day ago
-
1 week 3 days ago
-
1 week 3 days ago
-
1 week 3 days ago
-
1 week 3 days ago
-
2 weeks 4 days ago