Problem: I have a vm running on ‘the cloud’, which is useful for various things, including having my domain pointed at it. Now, nobody wants to run their own http server anymore because IT IS A DRAG. Using a page for personal sites is definitely in fashion these days, and it makes a lot of sense. I still want to be able to ssh into my vm, but I want http/https requests to go to my site. Hm?

Solution: Bounce requests for ports 80 and 443 off to the page by using apache as a reverse proxy. Cribbed the general directions from here. Now, the only reason this is a good idea and worked for me is because I already had apache2 installed, so just had to reconfigure it a bit. If you don’t have apache2 installed there’s probably a smarter way of doing this.

Edit your /etc/apache2/sites-available/000-default.conf and make it look like this

<VirtualHost *:80>
    # A simple redirect for http traffic
    Redirect /

<VirtualHost *:443>
    # Somewhat fancier for https
    SSLEngine On
    SSLCertificateFile /etc/apache2/ssl/ca.crt
    SSLCertificateKeyFile /etc/apache2/ssl/ca.key
    Redirect /

Restart your apache2 server (sudo service apache2 restart) and you’re done.