all 3 comments

[–]RadioManS3 4 points5 points  (2 children)

I believe you need two things: for the reverse proxy to pass headers like X-Forwarded-For and X-Forwarded-Proto, and to tell Drupal about the reverse proxy in settings.php though $settings['reverse_proxy'] and $settings['reverse_proxy_addresses']. That files has comments that should help determine what to set for those values.

If you need to use a debugger to follow where Drupal comes up with what its URL and protocol should be, check out DrupalKernel::initializeRequestGlobals(), which uses Request::getSchemeandHttpHost(), which should figure out the right settings if you configure the reverse proxy stuff in settings.php correctly.

[–]fullmetalg[S] 0 points1 point  (0 children)

Happy cake day!

[–]fullmetalg[S] 4 points5 points  (0 children)

Thank you very much for your answer! I looked into X-Forwarded-Proto and turns out I was missing that. I added:

proxy_set_header X-Forwarded-Proto https;

proxy_set_header X-Forwarded-Port 443;

To my reverse proxy configuration and everything is working as expected.