If the hostname and the sites folder are the same, the sites folder gets replaced with the load balancer IP address in $uri variable

Created on 28 May 2025, 10 days ago

Problem/Motivation

For sites with a multi-site configuration, or at least that have the same value for the host as the sites folder, the sites folder value gets replaced with the load balancer's IP address.

Steps to reproduce

On an Acquia site, let's say the host is example.com, and the files folder is in sites/example.com/files, running a drush p:invalidate command like the following:

drush --uri=llu.edu p:invalidate url https://example.com/sites/example.com/files/files_subfolder/1234567.json
drush --uri=llu.edu pqa url https://example.com/sites/example.com/files/files_subfolder/1234567.json

The resulting PURGE in Varnish looks like this:

{"time": "[28/May/2025:12:24:36 +0000]", "status": "200", "bytes": "428", "method": "PURGE", "host": "example.com", "url": "/sites/23.215.0.136/files/files_subfolder/1234567.json", "query": "", "referrer": "-", "user_agent": "Acquia Purge", "client_ip": "[Client IP redacted]", "time_firstbyte": "0.000138", "hitmiss": "miss", "handling": "synth", "forwarded_for": "[Forwarded_for redacted]", "request_id": "[Request ID redacted]", "ah_log": "", "ah_application_id": "", "ah_environment": "", "ah_trace_id": ""}

Proposed resolution

Somewhere around the line 400 of src/Plugin/Purge/Purger/AcquiaCloudPurger.php the replacement is too aggressive.

Remaining tasks

N/A

User interface changes

N/A

API changes

N/A

Data model changes

N/A

🐛 Bug report
Status

Active

Version

1.5

Component

Code

Created by

🇨🇦Canada sillygwailo Toronto, ON

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024