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

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

sillygwailo created an issue. See original summary.

janusman made their first commit to this issue’s fork.

janusman’s picture

Status: Active » Needs review
wtambaoan’s picture

Our application is a multi-site instance of Drupal where programmatically purging urls was not working. We were able to apply a version of this merge request as a patch in our production environment and the code works as intended to send urls to the PURGER to clear the varnish cache.

japerry made their first commit to this issue’s fork.