---
title: "How to customize Reverse Proxy Trusted Headers in Drupal"
date: "2025-02-05T23:57:42+00:00"
summary:
image:
type: "article"
url: "/acquia-cloud-platform/help/92926-how-customize-reverse-proxy-trusted-headers-drupal"
id: "3d241720-46ca-4cc0-b485-3fbbef8d8444"
---

Acquia Cloud automatically configures Drupal to run behind a reverse proxy, and most sites will not need to customize this configuration.

If you do need to adjust the default settings, we recommend using a specific format in order to ensure compatibility with different versions of Drupal and Symfony.

For example, to configure Drupal to trust the X-Forwarded-Host header, add this snippet _after the Acquia include_ in settings.php:

    // Trust the X-Forwarded-Host header.
    if (isset($settings['reverse_proxy_trusted_headers'])) {                           
      $settings['reverse_proxy_trusted_headers'] |= \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_HOST;
    }                                                                                  
    else {                                                                             
      $settings['reverse_proxy_host_header'] = 'X_FORWARDED_HOST';                     
    }

This should cover both the [older and newer formats](https://www.drupal.org/node/3030558).

Important Note

Please note that these configurations are only relevant to Drupal 8 (and later). There is no native support for custom reverse proxy header handling in previous versions of Drupal.