Help with pointing to Google Cloud Storage

Hi:
I have set up a js file on GCP with open access and right CORS so I can directly get the file link here.

I tried to set up a CNAME record named ‘gcp’ with domain name ‘ganibganapathi.com’ pointing to ‘storage.googleapis.com’. But trying to open the link gcp.ganibganapathi.com/coolprop/coolprop.js doesn’t get me what I see from the link above. How do I fix this? Clearly I’m doing something wrong. Please help.

thanks, Gani -

May I ask does the bucket have public access?

  • Public access status: Public to Internet

In terms of a CNAME record, is it :orange: proxied?

I am afraid there is a typo missing c, it should be pointed to c.storage.googleapis.com as my example from below screenshot (you have gcp, while mine is static):

As far as I use it too.

Source for help just in case:

And, nevertheless, I am afraid it’s still a question in terms of a SSL certificate (HTTPS serving) for it (could be I am wrong about it):

Also, a good way would be to configure a Page Rule for Cache Level: Cache Everything, Browser Cache TTL and the Edge Cache TTL options.

UPDATE: I forgot I was testing that out back a few months ago, and as @erictung stated, is should work fine with Full (Strict) SSL:

googleapis.com owns by Google. So it shouldn’t be related to Cloudflare.

Source: Page redirect from root to www not working - #7 by erictung

In both cases of course, the Full (Strict) SSL working and the resources being cached at Cloudflare and served through it to the end-users (visitors) of my Website(s).

Source: Serving static content from a different domain (not subdomain) - #2 by fritex

I have checked and as I use Full (Strict) SSL (with Authenticated Origin Pulls even for my server) it’s working properly.

Tested it again few moments ago.

Last but not least, kindly have a look at the below article for more information regarding correct SSL settings and consider having properly setup SSL at Cloudflare:

1 Like

Thanks for the detailed response! I will check it out and see what’s up.

BTW, will I be able to cache this once fixed?

Gani-

Hi @fritex:

I looked at your recommendations and I’m afraid I’m completely lost. I just set up Google Cloud Storage over the weekend and so also Cloudflare. I have done the following:

  1. In GCP I created bucket coolprop and object coolprop.js. I’ve set permission open access and the right CORS settings.
  2. In Cloudflare created domain ganibganapathi.com
  3. Under DNS management, created 2 records with CNAME - one named gcp with target ‘c.storage.googleapis.com’ and the other @ for root. Both are proxied and auto TTL.

With these settings, I thought I should be able to get to the site https://storage.googleapis.com/coolprop/coolprop.js, but unfortunately that is not the case. I’m getting the following error -

NoSuchBucket
The specified bucket does not exist.

What am I missing? I appreciate any help. The links you provided are good but too much detail and I’m a bit lost to be honest.

thanks, gani -

If there is a way to provide a list of things to do (and check along the way) as I’ve outlined above, that would be most helpful.

This is a bucket name.

Or rather, you have had coolprop folder/directory in your bucket, so the URL should be like gcp.yourdomain.com/coolprop/file.js (or coolprop.yourdomain.com/coolprop/file.js if bucket name contains coolprop and you have directory coolprop inside it and also CNAME coolprop at the DNS tab of Cloudflare dashboard).

Your CNAME record is gcp.
It should be named as same as your bucket coolprop to make it work.

Or, better way to re-check and rename your bucket to gcp.yourdomain.com - must contain bucket-name.yourdomain.com (actual, this here is an example maybe you are missing a domain name part in your bucket name?).

That’s good.

Not needed and actually would cause some issues I think.

I would better if I want to serve static website from a bucket, create another bucket.

  1. Screenshot of Google Cloud Platform → Google Storage, where your bucket is (to see if the name of the bucket is the gcp.ganibganapathi.com)
  2. Screenshot of your DNS tab where the CNAME gcp record can be seen (:orange:) and pointed to c.storage.googleapis.com
  3. Screenshot of options for the Bucket (if it is public online, etc.) just in case if missing Permissions → Storage Object Viewer → AllUsers?, etc.

My example:

third_one

@fritex, just wanted to say thank you as it worked after fixing the error you spotted. There was one additional step - I had to verify I am the owner of the coolprop.ganbganapathi.com on the GCS Webmaster Central site. Once that was done, I was all set.

Thanks again!
gani-

1 Like

I am happy to assist you :wink:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.