19

I have a http triggered cloud function deployed in the europe-west1 region and a web app hosted with firebase hosting. I have also setup a rewrite to that http function in my firebase.json file.

I have noticed that the rewrite only works with us-central1 functions.

Is there a way to make the rewrite work with europe-west1 functions?

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
dergoegge
  • 381
  • 2
  • 11
  • I have noticed the same problem. Could you figure it out in the meantime? – Martin Reiche Aug 02 '18 at 10:16
  • 1
    Now that there is official support for other regions it states in the [docs](https://firebase.google.com/docs/functions/locations#http_and_client_callable_functions) that "**_If you are using HTTP functions to serve dynamic content for hosting, you must use us-central1_**". So i think we have to wait and see if they will change that. – dergoegge Aug 03 '18 at 08:46
  • Ah, thanks for pointing that out. I must be blind ;) – Martin Reiche Aug 04 '18 at 07:05
  • That sounds like an answer @dergoegge! :) – Frank van Puffelen Nov 19 '18 at 15:22

3 Answers3

6

Now that there is official support for other regions it states in the docs that "If you are using HTTP functions to serve dynamic content for hosting, you must use us-central1". So i think we have to wait and see if they will change that.

dergoegge
  • 381
  • 2
  • 11
2

As of 2021, Hosting rewrites to functions work for us-central1 region only

Firebase Hosting supports Cloud Functions in us-entral1 only

Abraham
  • 12,140
  • 4
  • 56
  • 92
2

Since August 2022 it is now possible to configure Firebase Hosting routes to rewrite to Cloud Functions in a specific region.

See this update in the public issue tracker, and the documentation on direction HTTPS requests to your function where you can now specify a region too. The region is optional and if region is omitted from the hosting config, the Firebase CLI will attempt to automatically detect the region from the function's source code.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • It is worth noting: This feature will only work with the updated Firebase CLI as several deployment changes were made. Older CLI versions will not work. I had to update from 9.10.0 – Lucem Nov 14 '22 at 13:15