Wrong protocol detected by Drupal

10/30/2019

I have a problem with Drupal 8.7.x where it is detecting that it's using HTTP instead of HTTPS for some of URLs.

These are settings that I have set in settings.php

$settings['reverse_proxy'] = TRUE;
$settings['reverse_proxy_addresses'] = array($_SERVER['REMOTE_ADDR']);
$settings['reverse_proxy_trusted_headers'] = \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_ALL | \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_FOR;

AWS EC2 servers are behind Elastic Load Balancers. But Nginx inside Kubernetes that are running on EC2.

Do you have any idea what could be the issue and what could be done to fix this issue?

-- Zemljanin
amazon-elb
amazon-web-services
drupal-8
kubernetes
nginx

0 Answers