Skip to content

Update or remove trusted_host_patterns settings in settingsacquia-custom.php #143

Description

@byrond

Do these lines do anything?

$settings['trusted_host_patterns'][] = "^{$_ENV['AH_SITE_ENVIRONMENT']}dev.prod.acquia-sites.com";
$settings['trusted_host_patterns'][] = "^{$_ENV['AH_SITE_ENVIRONMENT']}stg.prod.acquia-sites.com";

Because they reference the AH_SITE_ENVIRONMENT environment variable, they result in values like:

  • devdev.prod.acquia-sites.com and devstg.prod.acquia-sites.com
  • proddev.prod.acquia-sites.com and prodstgprod.acquia-sites.com

The trusted host patterns for each environment are set in the /var/www/site-php... includes:
https://support-acquia.force.com/s/article/360037529873-How-is-the-trusted-host-patterns-configuration-set-on-Acquia-Cloud

I believe the default settings account for additional domain names on environments.

Should we just remove these lines or just comment them out and maybe update them to something like:
// $settings['trusted_host_patterns'][] = "^example.com";

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions