Every time Apache accesses a directory, it will look for an .htaccess file in that directory as well as in the parent directory -- and the parent's parent directory, all the way up to the way up to the root of the DocumentRoot! Think about what that does on every request when your site is busy. Addressing this is actually very simple.
The official ...
There were multiple issues. For once port 80 was only accessible from a specific address I changed that in the firewall. Also the configuration mentioned is not redirecting for me even though I set Use Secure URLs on Storefront to Yes. The way I solved the issue is that I set the https url for base urls and base urls ( secure )
Magento has default functionality for set secure(https) and unsecure(http) url.
Before update bellow setting backup core_config_data table.
Go to Store-> Configuration-> General-> Web->Baseurl(secures) and
update http to https.
Update the value of Use Secure URLs on Storefront to Yes.
Refresh cache php bin/magento cache:clean.