Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forcing HTTPS behind TLS termination for Drupal 8/9 #63

Open
stevenlafl opened this issue Sep 16, 2021 · 1 comment
Open

Forcing HTTPS behind TLS termination for Drupal 8/9 #63

stevenlafl opened this issue Sep 16, 2021 · 1 comment

Comments

@stevenlafl
Copy link
Member

stevenlafl commented Sep 16, 2021

Alt title: How to force Drupal 8/9 to output HTTPS URLs when using an nginx reverse proxy


Insert into settings.php

$settings['reverse_proxy'] = TRUE;
$settings['reverse_proxy_addresses'] = array($_SERVER['REMOTE_ADDR']);

And forward appropriate headers with nginx config

proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Port 443;

Or with apache in mod_headers.c section

RequestHeader set X-Forwarded-Proto https
RequestHeader set X-Forwarded-Port 443

Thanks @jeffbeagley

@stevenlafl
Copy link
Member Author

Need to add to the README file. Task up for assignment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant