Ghost installation - too many redirections

Issues when setting up Ghost on AWS.

Here I'm hosting my website on AWS, where the Ghost package is managed by bitnami. After I installed Ghost on AWS following the official setup (see here), I met the following issues:

The first one is that view site that refused to connect. According to the Internet, this is because the view site window is directing to "". But, after having configured Https, the view site should direct to "https://...". This can be fixed by using the following code:

ghost config url

However, this will cause the website fail to be loaded due to redirecting too many times. This can be fixed by going to

cd /opt/bitnami/apache2/conf/vhosts

and find the file ghost-https-vhost.conf. Open the file and add RequestHeader set X-Forwarded-Proto "https" like the following way

<VirtualHost _default_:443>
    RequestHeader set X-Forwarded-Proto "https"
    ServerAlias *

Restart Ghost and apache by using

sudo /opt/bitnami/ restart ghost
sudo /opt/bitnami/ restart apache

and the problem is fixed.