2

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.

Gary
  • 23
  • 2

1 Answers1

2

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
Brandon Yarbrough
  • 37,021
  • 23
  • 116
  • 145
  • So the subdomain being used to serve the content from Google's CDN (say cdn.mysite.com) will be able to be listed as https://cdn.mysite.com/image.jpg? My main concern was the mixed-content error making my page show insecure but if I can do that I should be alright. Also right now I'm just using one VM instance; no VM groups or anything. EDIT: sorry it removed http and https from my examples – Gary Apr 04 '17 at 20:18
  • You can also use your own domain name with Cloud CDN and Load Balancer. Look into Global Forwarding Rules: https://cloud.google.com/compute/docs/load-balancing/http/global-forwarding-rules – Brandon Yarbrough Apr 05 '17 at 16:43