I am looking to host multiple sites using firebase but have read something that could cause problems.
Each custom domain is limited to having 20 subdomains per apex domain, due to SSL certificate minting limits.
https://cloud.google.com/storage/docs/hosting-static-website
I was hoping to use subdomains, e.g. a.example.com, b.example.com ...etc.
This limit of 20 domains seems quite restrictive and I have some questions
If I create separate projects for each subdomain does this limit still apply? e.g. have 1 firebase project with a hosting site for a.example.com and have a entirely separate firebase project for hosting b.example.com.
I have also read you can hosting using cloud storage and a load balancer. https://cloud.google.com/storage/docs/hosting-static-website. Does this provide an automatic certificate or is it manual?
Does the limit of 20 subdomains apply only to firebase hosting or does it also apply to hosting via cloud storage and a load balancer?
Thanks
This limit is per project, so if you put different domains on different projects they are not affected by it.
The documentation seems to describe the process pretty well: https://cloud.google.com/storage/docs/hosting-static-website#lb-ssl
This limit applies to Firebase Hosting only. Other products may have their own limits of course, but those would be listed in the documentation for that product.
I want to be able to add domains to Firebase hosting with the API instead of the web UI, is that possible?
I want to add potentially hundreds of domains, is there a domain limit per project in Firebase?
As far as I can tell from the entire CLI documentation, there isn't any way to do this.
Lets take a step back and consider what the web UI process involves i.e. the generation of a TXT record to add to your DNS records, after verifying the presence of said TXT record on the domain, providing A records that you (authorized owner) add to allow redirecting to your firebase hosted site.
In my opinion, this very manual back and forth is necessary as a security measure. The only way it is taken out of the equation via the CLI is by providing a means for you to authenticate ownership of a domain (registered with any one of many domain registrars), and being granted authorization to change your A records. These are both outside the scope of Firebase, and could potentially introduce severe security flaws. Regardless, even if it existed, it would still have to be step-by-step and somewhat manual via CLI rather than the single command it sounds like you're looking for.
It is not possible to add custom domains automatically through an API at this time.
Nor would it allow you to create a reseller or multi-tenant project (i.e. connect a large number of domains or subdomains dynamically) since you cannot connect more than about 36 domains connected to one project.
It's possible to add domains using Firebase Hosting Rest Api. I am not sure why they didn't put it on their official website but I checked today and it works. https://developers.google.com/resources/api-libraries/documentation/firebasehosting/v1beta1/java/latest/com/google/api/services/firebasehosting/v1beta1/FirebaseHosting.Sites.Domains.html
Answer that I've received from Firebase support:
There is no API yet that would allow you to add custom domains, it was
requested as a feature before but unfortunately we have no more
information on that - so for now, only the Console UI allows you to do
it.
When it comes to the limits, in a project, a custom domain is
attached to a site - there can be 36 sites per project, and for one
site there is no hard limit, but we recommend not exceeding 20 custom
domains. You can experience technical issues with SSL certs when you
exceed 20 domains per site, which we won’t be able to troubleshoot
since the system was not designed for such use cases.
I have been trying to find how many requests can be made to a static website hosted via firebase but I can't seem to find an answer.
There are no limits to the number of requests. In terms of cost, everything you need to know is on the pricing page. Pricing has nothing to do with the volume of requests.
I'm setting up a website hosted on Firebase. Currently, I'm using the Mautic for email automation which is currently going to Spam. My technical resource told me it was because I needed to set up rDNS records.
Does anyone know if Firebase supports this? I couldn't find any answers on here or Google.
Firebase Hosting doesn't do any DNS hosting at all. You'll need to use some other DNS provider, which can often be the registrar of your domain.
This question already has an answer here:
Firebase custom domain name for database
(1 answer)
Closed 4 years ago.
Let say i have a firebase db at https://vivid-fire-id.firebaseio.com/.
So the browser will try to connect to vivid-fire-id.firebaseio.com particular domain.
Is there way to add a custom domain from which the db is accessed from?
For eg: https://firebase.mydomain.com
This is required to make sure that firewalls do not create problem while access our application.
api gateway can be one of possible solution. Google search reveals lot of info on api gateways
Treat firebase as a microservice.