Why do I get this "Could not reverse map the HTTPS VirtualHost to the original" message when I try to install an SSL?

I’m trying to set up a vhosts file on my server with separate vhost txt files in it. Everything seems to work fine and I am able to reach both of the areas I try to set up using http. When I try to install an SSL cert however, it always comes up with a message telling me:

Could not reverse map the HTTPS VirtualHost to the original

 - Unable to install the certificate
 - Congratulations! Your certificate and chain have been saved at:

I’ve tried reinstalling and restarting the droplet 3 times now and every time it is the same. I don’t know what I’m doing wrong I’m new to all this. Could someone help point me in the right direction?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

The perfect template. Try this. Worked for me after days of looking for a solution.

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html
	<Directory /var/www/html/>
            Options FollowSymLinks
            AllowOverride All
            Require all granted
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

This happened to me, when i tried to setup (rewrite) old droplet domain with another. The problem was that in sites-enabled/ (or in other one, or in htaccess too) there was forced redirection from non-https to https version (using RewriteRule ^ .....) . So, while site is till not using HTTPS, that forced redirection makes the problem, comment those lines before your site has SSL.

you should at first enable the ...ssl.conf one in sites-available (like sudo a2ensite my-ssl.conf) and inside that, put this: ServerName YOURDOMAIN.LTD