0

my site is up and running, but all my form submits get redirected to an http:// link. The redirect from http to https on my Server (Apache on EC2) is configured and you don't see any effect as a user. If i create baseurls directly on the server it also returns http:// links.

It causes troubles on the intern side:

  • Google Analytics can't track this redirects as the same user and sees every form submit as an new user from a direct source.
  • the redirect causes a delay for the user (mostly millisecs)

Config:

  • running an Drupal 8.7.7 on an Apache Server.
  • http-redirect:
    RewriteCond %{HTTP:X-Forwarded-Proto} !https
    RewriteCond %{HTTP_USER_AGENT} !ELB-HealthChecker
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  • settings.php:
  $settings['reverse_proxy'] = TRUE;
  $settings['reverse_proxy_addresses'] = array($_SERVER['PROXY_ADDRESS']);

  $settings['reverse_proxy_trusted_headers'] = \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_AWS_ELB;

This config for setting.php was introduced in 8.7.0: https://www.drupal.org/node/3030558

I really don't have any clue what to do now, since i tried like thousands of possibilities.

Best Regards FirstSanny

closed as off-topic by Clive Sep 10 at 15:33

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question was caused by a problem that can no longer be reproduced, was solved by a cache clear, or was a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers." – Clive
If this question can be reworded to fit the rules in the help center, please edit the question.

1

Got it myself.

Configuration is absolutly correct, but i set the wrong reverse_proxy_adresses to be allowed. I thought, that i can use the beanstalk-url, but it worked perfectly fine with one of the internal IP Configs for AWS: 172.16.0.0/12

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