SomeBruh
SomeBruh

Reputation: 460

Direct Firebase Hosting to Cloud Functions deployed in other regions

I updated the Firebase hosting rule following this document so I can have the cloud function end point using my own domain name. However it seems this only applies to the cloud function deployed in the default region in us-central1.

"hosting": {
 "rewrites": [ {
   "source": "/endpoint",
   "function": "app"
 } ]
}

But whenever my functions are deployed like the following, the aforementioned the custom domain no longer works because it would still forward the requests to us-central1 rather than asia-east2 resulting in a 403 error.

functions.region('asia-east2').https.onRequest((request, response) => {
    response.send("Hello from Firebase!");
});

Does anyone know how this issue could be fixed? Many thanks!

Upvotes: 2

Views: 416

Answers (1)

Doug Stevenson
Doug Stevenson

Reputation: 317487

EDIT Aug 2022: Now, according to the documentation, regions can now specify non-default regions.


The behavior you're observing is expected, and documented. From the Firebase Hosting documentation:

Important: Firebase Hosting supports Cloud Functions in us-central1 only.

Upvotes: 4

Related Questions