0
votes

we are testing Google Cloud for hosting our websites. We have about 10 domains which all serve static html pages and which are hosted on the same server.

We want to move our whole static domain content to GC - we only need to provide about 10 MB so the cost for Cloud Storage and Network traffic should not be very high ;)

However, we need SSL connection to our cloud buckets and want to cache all websites (or at least all css/js files) over Cloud CDN. I searched and found out that we need to use loadbalancing for the SSL connection - which would take about 99% of the cost compared to what we need for bandwidth and storage.

So my questions are:

  • Can we use Google Cloud CDN without loadbalancing?
  • Can we have SSL Connections without Loadbalancing
  • If we need Loadbalancing:
    • How many forwarding rules do we need? One per domain/bucket? Or is one rule enough?

Thank you in advance and best regards

3

3 Answers

0
votes

Yes, Google cloud storage only supports Domain with HTTP, and for HTTPS you need loadbalance or Thridparty CDN.

So either you can serve content from HTTP only or

An alternate work around is masking & forwarding the Google storage URL with you domain from the Domain Name provider panel itself.

Don't verify domain with Google and directly forward & mask https://storage.googleapis.com/ with your domain.

Check for Forwarding option under your Domain Management Panel. Use forward type as Permanent (301) & Use Forward with masking under settings

0
votes
  1. According to this link, you have to use HTTP(S) Proxy Load-Balancing:

    Cloud CDN uses HTTP(S) load balancing as the origin for cacheable content. You must use HTTP(S) load balancing as the origin of content cached by Cloud CDN.

  2. You can easily do that for instances, all you have to do is open port 443 for the instances, which you can easily do by checking the Allow HTTPS Traffic checkbox in the instance's properties. For buckets that can also be done: if you create a public link, you'll be accessing it via HTTPS by default.

  3. Depends on how you want to implement things. You can create forwarding rules for storage buckets, in which case you'll have to create one for each bucket; for content served by instances, it's up to you how many rules you want to use. You don't have to create one per domain: if you have virtual servers configured in your Apache backends, then you can redirect everything to there; if you want to have different backends for different domains, then you'll need at least one rule per domain.

At the end of the day, if you don't want to use Cloud CDN, you could implement a few caching instances yourself: you could create an instance in regions that'd benefit from having a cache, putting local SSDs in them, and running Varnish or some other caching software in them. Or, like the other user said, you can use a 3rd-party solution: I know for a fact CloudFlare has dedicated physical connections to Google that speed up their access to your cloud infrastructure by a lot.

0
votes

For what you want to do, the most reasonable solutions seem to be:

Firebase has a free tier, and good customization (404s/redirects/rewrites/headers/etc), but you need the pay-as-you-go plan to host multiple sites.

Cloudflare also has a generous free tier, but customization comes extra.

App Engine has a better free tier and lower prices than Firebase. The above project (full disclosure: I'm the author) implements most of Firebase Hosting on top of App Engine.