Search code examples
sslgoogle-cloud-storagegoogle-compute-enginelets-encryptgoogle-cloud-cdn

Utilizing Google's Cloud CDN without a Google Storage Bucket


I've searched the forums and the documentation that Google Cloud provides but I can't seem to find the specific answer I'm looking for. To give a little bit of backstory I'm currently running a virtual machine on Google's Compute Engine; just using it to host websites (Debian, nginx, MariaDB, PHP7).

Google has one tutorial that walks through setting up their CDN with one of their storage buckets, but a.) it requires a backend service which I'm not familiar with setting up or the overall concept b.) it states that using the CDN with one of Google's storage buckets means I will not be able to use the CDN over HTTPS (currently using a LetsEncrypt SSL cert).

So I guess what I'm getting at is what are my options to use Google's CDN with HTTPS. Do I need to get a storage bucket at Amazon AWS for example and link the CDN to that? Or would I be able to setup Google's CDN with one of their storage buckets and implement my own SSL cert? Any documentation, tutorials, etc would be greatly appreciated.


Solution

  • Google Cloud CDN works fine with both HTTPS and with services running on GCE. It does not require the use of GCS at all.

    A "backend service", in Cloud CDN nomenclature, is either a Compute Engine virtual machine (VM) instance group or a GCS bucket. You want the former.

    If you're already serving content from a GCE instance group via Google Cloud Load Balancing, enabling Cloud CDN can be done by running this command:

    $> gcloud compute backend-services update BACKEND_SERVICE_NAME --enable-cdn