Search code examples
google-cloud-platformprestashoplets-encryptprestashop-1.7certbot

Too Many Redirects Error in GCP while integrating Lets Encrypt SSL for PrestaShop


I've started learning Google Cloud Platform (GCP). I want to host an e-commerce website using PrestaShop CMS. This CMS is readily available as a Google Click To Deploy product in the GCP Marketplace. Everything works totally fine unless I start using the Let's Encrypt SSL Certificate in the website. I have successfully set-up the Cloud DNS configurations and the domain name is pointing to correct IP address of VM instance (where the website is being hosted). But once I run Lets Encrypt's Certbot, I don't know what it does to my website but it starts giving me an error in the browser - ERR_TOO_MANY_REDIRECTS .

UPDATE I'm posting some screenshots that I've collected about conf files. My domain name is www.themkumar.com but I couldn't find it in any of the conf files. If someone could tell me how to add it there, I'll be really grateful to you.

The domain is correctly pointing to VM instance

There are 3 different conf files in the system

This is prestashop configuration file

This is 000-default configuration file


Solution

  • FINALLY, I solved this issue!

    I just found that configuring any domain in Google Cloud DNS doesn't make any changes to it's virtual host file. I had to add my domain in 000-default.conf file so that it can get visible to the Certbot. I altered this file and added my domain then followed the quick process to generate the SSL certificate for my domain. After that, I logged into my PrestaShop admin panel and enabled SSL Certificate for all the pages. This is what that configuration file look like after adding your domain. After that, it's working totally fine. If anyone ever faces this same issue, feel free to ping me I won't mind answering you guys even if you're a totally newbie!