In the settings.php file if the site, I added the following line.

$settings['trusted_host_patterns'] = array(

I'm using Drupal 8.2.6.

Do I need to add the proxy address too, or my IP? It is a single domain.


Every entry in the array contains a RegEx. So you must escape the dot too.

$settings['trusted_host_patterns'] = array( '^www\.example\.com$' );

This will match the exact the host "www.example.com".

| improve this answer | |
  • thank you Alexander I've done it $settings['trusted_host_patterns'] = array( '^www\.nonigesto\.org$', '^novigesto\.org$', '^xxxx-xxxxx\.xxxxxxx\.xxx$', ); the server is a big name with points every point is replaced by \. right? and IP is needed? – Rosina Ramos Novigesto Feb 24 '17 at 14:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.