-1

My domain is registered with Google Domains. I put up my static website on Google Cloud Storage. The Cname record being c.storage.googleapis.com.

I had an SSL cert already for this domain, and wanted to set it up. I uploaded the SSL cert successfully to Google Cloud App Engine. It gave me a new Cname value to tie to my DNS, this time ghs.googlehosted.com

I can't do both for www

Anybody know whats up? I thought there would be a simple way to point my existing ssl certificate to my domain without having to do load balancing or anything too complicated. There is very little traffic to the site. I transferred everything over from a different hosting provider, and this is the only issue.

Tj Keel
  • 11
  • 2

2 Answers2

1

Possible solutions -

  1. To use HTTPS with your own domain, you'll need to set up Google Cloud Load Balancer. Google Cloud Load Balancer allows you to fill a domain with all sorts of content. Some resources could be served by a GCS bucket, but you could also have servers in GCE serving dynamic content for other paths.

  2. Use firebase to host your SPA, they by default have https.

  3. Use App engine to serve static files https://github.com/ncruces/appengine-hosting

  4. Use something like cloudflare infront of it, which provides https for custom domain.

mdeora
  • 4,152
  • 2
  • 19
  • 29
  • Thank you. I'm attempting to do the first proposed solution. I've created a HTTPS Load Balancer, with the backend being the static Storage Bucket containing my website files. For Host and Path Rules, I didn't specific anything other than the default bucket path. For the front end, I applied my SSL certificate successfully, and set the protocol to HTTPS. That seems to be everything I needed to do, but I still can't access my website via https. Is there more that I need to do? Thanks. – Tj Keel Jun 29 '18 at 18:22
  • I believe the problem is the frontend IP:Port is not correct. Google chose that automatically, but does it not have to be my domain? – Tj Keel Jun 29 '18 at 18:24
  • make sure you use target HTTPS proxy instead of target HTTP proxy. Other than that it should be straight forward. – mdeora Jun 29 '18 at 19:35
1

In order to host your static web page within a Cloud Storage bucket and use HTTPS, you need to configure a load balancer with a static external IP address. This guide [1] shows how to configure load balancing service and sending traffic to the instances. You can follow the configurations, skipping the instance parts since your goal is sending traffic to a bucket.

Afterwards, route your load balancer to the Cloud Storage bucket having your static web page [2].

Finally, go to your domain host and set an A Record, instead of CNAME [3], hitting your load balancer's external IP.

Yurci
  • 556
  • 2
  • 9
  • Hey, thanks for the response. I've followed all of those steps, but I still get an issue. My domain displays this message when I try to load it: NoSuchBucket The specified bucket does not exist. I think my bucket is somehow not linked correctly, any ideas? – Tj Keel Jul 16 '18 at 22:13
  • You can also see this red bucket on my backend load balancer, indicating that the bucket isn't correctly connected: https://imgur.com/a/h2Dq286 I use www. before my domain name, but it always drops it after I save? – Tj Keel Jul 16 '18 at 22:15
  • you can create buckets starting with [www.](https://cloud.google.com/storage/docs/domain-name-verification?hl=en_US&_ga=2.213944599.-1821529035.1529418084&_gac=1.37037076.1528970398.EAIaIQobChMIyr6qxPLS2wIVA4bVCh2ZWg3sEAAYASAAEgKM_PD_BwE#top_of_page). First you need the create your domain named [bucket](https://cloud.google.com/storage/docs/creating-buckets), then you can add it to your backend. – Yurci Jul 17 '18 at 07:24