I have followed the below link and added authentication for Bitnami Magento 2.3.2 development site which is in AWS Lightsail.
https://docs.bitnami.com/bch/apps/magento/administration/use-htpasswd/
I have created htpasswd and magento_users using,
cd /opt/bitnami
apache2/bin/htpasswd -cb apache2/magento_users USERNAME PASSWORD```
Also I have added the below code in /opt/bitnami/apps/magento/conf/httpd-app.conf
<Directory "/opt/bitnami/apps/magento/htdocs">
...
AuthType Basic
AuthName MyAuthName
AuthUserFile "/opt/bitnami/apache2/magento_users"
Require valid-user
...
<IfVersion >= 2.3>
# Require all granted
</IfVersion>
...
</Directory>
After I have restarted the apache and flushed the cache, It asked for username and password when loading dev frontend. When I provide credentials, it end up getting error as,
Error 503 Backend fetch failed
Backend fetch failed
Guru Meditation:
XID: 393256
Varnish cache server
I can't see anything related to this in Apache error_log.
Can anyone please help me out to fix this issue.