geerlingguy / drupal-for-kubernetes

Drupal Example Site for Kubernetes
http://www.pidramble.com
GNU General Public License v2.0
163 stars 51 forks source link

Configure trusted host settings in Docker container environment #34

Open geerlingguy opened 4 years ago

geerlingguy commented 4 years ago

From the Status report page (https://www.pidramble.com/admin/reports/status):

Not enabled The trusted_host_patterns setting is not configured in settings.php. This can lead to security vulnerabilities. It is highly recommended that you configure this. See Protecting against HTTP HOST Header attacks for more information.

I should add a setting for www.pidramble.com in production, or localhost locally.

dcwestra commented 1 year ago

Trying to figure this out myself. Tried passing it as a "command:" in docker-compose.yml, but due to the square brackets contained in the code, docker-compose did not like it. It will not allow [] to be passed as a string. Need to try adding it as a .txt file and cat the file to settings.php.

dcwestra commented 1 year ago

Nevermind. The instructions are in the drupal docs. Justus tested and it works.

https://www.drupal.org/docs/getting-started/installing-drupal/trusted-host-settings#s-advanced-instructions