I had this issue after AWS Lightsail snapshot restore.
Way to restore a snapshot is to click on the three dots on side "create new instance"
Then attach the the static ip.
I observed redirect loops after this. (pain!!!)
Later we figured out that the redirects was caused by the changes to urls as the base urls changed to IP address.
There are two ways to fix this.
1. via phpymyadmin > In AWS you need to connect via Putty with Key and tunnel via 8888
https://127.0.0.1:8888/phpmyadmin then
on table core_config_data check the base url update base if IP address.
then change.
web/secure/use_in_frontend set value from 1 to 0
web/secure/use_in_adminhtml set value from 1 to 0
Then clear magento cache.
- via cli.
/opt/bitnami/apps/magento/htdocs/bin# ./magento-cli cache:flush
Flushed cache types:
config
layout
block_html
collections
reflection
db_ddl
compiled_config
eav
customer_notification
config_integration
config_integration_api
full_page
config_webservice
translate
vertex
mysql> update core_config_data set value=0 where config_id=115;
mysql> update core_config_data set value=0 where config_id=114;
mysql> select * from core_config_data where path like '%web/secure/use_in_frontend%';
+-----------+---------+----------+----------------------------+-------+
| config_id | scope | scope_id | path | value |
+-----------+---------+----------+----------------------------+-------+
| 114 | default | 0 | web/secure/use_in_frontend | 0 |
+-----------+---------+----------+----------------------------+-------+
1 row in set (0.00 sec)
mysql> select * from core_config_data where path like '%web/secure/use_in_adminhtml%';
+-----------+---------+----------+-----------------------------+-------+
| config_id | scope | scope_id | path | value |
+-----------+---------+----------+-----------------------------+-------+
| 115 | default | 0 | web/secure/use_in_adminhtml | 0 |
+-----------+---------+----------+-----------------------------+-------+
1 row in set (0.00 sec)