Magento 2 Admin url not opening?
You can try the below tips.
This was exactly what I needed. Also, if it’s more convenient to do this from the command line rather than editing records in the database, it’s
magento config:set web/secure/use_in_adminhtml 1 and
magento config:set web/secure/use_in_frontend 1