Search code examples
firebasegoogle-cloud-functionsload-balancinggoogle-cloud-cdnurl-masking

Create an external load balancer to Cloud CDN with Cloud Functions


I try configure my Google Cloud Functions by using CDN. I try use this tutorial: https://cloud.google.com/cdn/docs/setting-up-cdn-with-serverless

With one function as Backend Endpoint looks all good, and if I open Load Balancing Frontend IP I see same result as I open direct function URL. And seems that this means this function now work over CDN if I use this IP.

But I have too many functions, because of this I try use URL mask for all functions in my Endpoint. URL mask looks like this:

https://us-central1-my-real-project.cloudfunctions.net/<function>

Problem that I cant understand how I can use Load Balancing Frontend IP for my Endpoint with Cloud Functions created with URL mask. When I open Load Balancing IP I get:

Error: Not Found
The requested URL / was not found on this server.

PS. Same if I try open http://<load-balancing-frontend-ip>/my-function-name

UPD:

Configurations in screenshots placed in google drive:

https://drive.google.com/drive/folders/1eI9tx_SQcJ_uJrlt-xzeZua9bwklszik?usp=sharing

(sorry, not know how share other way configuration, and cant attach images direct in question because of low reputation)


Solution

  • As described in the documentation, the URL mask must be only /<function>. No URL before.