貴重な情報を頂きまして、ありがとうございます。
AWS (Amazon Web Services) のロードバランサELB (Elastic Load Balancing) を使用している場合、下記設定が必要なのですね。
[AWS Application Load Balancer with SSL – Tensult Blogs – Medium]
https://medium.com/tensult/application-load-balancer-with-ssl-ab39d41d63c5
Modify Application
The steps added below are applicable to any Apache based application. I have considered Moodle as the application here.
1) In the moodle directory create a .htaccess to accommodate http re-write rules.
RewriteEngine On
RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]
2) Edit moodle/config.php to replace http with https
$CFG->wwwroot = ‘https://www.yourdomain.com';
3) To have load balancer support add the line below to moodle/config.php
$CFG->sslproxy = 1
4) Restart the web service.
5) Access the moodle web site from your web browser and test it.
UPDATE: AWS recently added redirection feature to Application Load balancer so now we can directly use ALB to redirect the web request from HTTP to HTTPS.