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!
us-central1
. If what you require is a custom domain connecting to the function and do not tightly relied on Firebase CDN, I think you can give Cloudflare a try, setting CNAME on Cloudflare linking to the domain of your funciton in another region. Though not testing yet myself, I'm also finding a solution to this. – momocow