Connecting subdomain to firebase - firebase

I am trying to use dynamic links for firebase using my custom domain link.
For the above purpose, I added the custom domain on firebase web hosting, and followed all the steps, but status is still showing as "Needs setup".
My main domain pointing to some other host, the sub domains pointing to some aws elastic ips, and now the newly created sub domain to firebase ips. The dns provider that i am using is cloudflare.
www.maindomain.com => webflow host
subdomain1.maindomain.com => aws elastic ip 1
subdomain2.maindomain.com => aws elastic ip 2
firebasesubdomain.maindomain.com => firebase ip records (A Records).
I cannot delete all the A records just to point to firebase, since the aws elastic ip's are my live servers serving my customers. So my question is keeping all of the above records intact is there a way to point my subdomain to firebase and transfer only the subdomain's ownership to firebase, where then i can easily create dynamic links for that domain as well?

When connecting a domain to Firebase Hosting, you must ensure your A records are pointing directly to the Firebase IP addresses. You can check this using e.g.:
dig firebasesubdomain.maindomain.com
If the Cloudflare proxy is turned on, Cloudflare will set the A records to their own IP addresses and Firebase Hosting will not be able to recognize the IPs. You should turn off the Cloudflare proxy, as Firebase Hosting is already serving content over a CDN and proxying will only introduce additional latency.

Related

How to prevent user access to IP address for a website hosted in GCP?

I have a Wordpress website (Bitnami) thats hosted in Google Cloud Platform. The IP address is something like: 33.33.33.33. My domain is hosted on Google Domains and has 2 nameservers pointing to Cloudflare. On the Cloudflare DNS settings, I have 2 A records, one is ftp and the other is something like 'mywebsite.com'. I also have a CNAME which is www mywebsite.com.
I am able to hit the full URL of my website but I also notice I can enter the IP address and it also works and loads the website. Is it possible to prevent acccess to 33.33.33.33 and only allow the full URL?
Create VPC Firewall Rules that only allow Cloudflare IP addresses.
Consult this document for the current Cloudflare IP list.
Google Cloud VPC firewall rules overview
Note: Cloudflare does not support FTP, so you must point your DNS resource record for FTP to your server's IP address and not through Cloudflare. I recommend that you do not use FTP. Use SSH/SFTP for file transfers. Configure WordPress so that installing plugins, uploading images, etc do not require FTP. FTP is not encrypted which means your login username and password are sent in the clear.

Reusing custom domain between GCP and Firebase

I am planning to host 2 webapps using Firebase Hosting: example.com and dev.example.com. For corresponding APIs, I have 2 projects on GCP (using managed instance groups and a load balancer) with custom domains: api.example.com and dev-api.example.com.
Is it possible to have a setup where subdomains of the custom domain example.com can be split/used across Firebase and GCP load balancer? I thought this is a popular setup but can't find any documentation/howto around this. I am using Google Domains as the domain provider for example.com and using Google Managed SSL certificates as well. All the projects belong to one account.
Assuming that you are using a Classic HTTPS Load Balancer with your GCP project, you may get your Firebase Hosting linked to your LB as an additional backend through Internet Network Endpoint Group so all of them can be reached through the same Load Balancer IP.
To do this,
Edit the current Load Balancer and go to Backend configuration
Create a Backend Service, under Backend type, select Internet Network Endpoint Group
Under Backends > New Backend, Create Internet Network Endpoint Group. This will take you to Network endpoint groups under Compute Engine
Under New network endpoint > Add through, you may select IP and port or Fully qualified domin name and port. Just supply the correct FQDN or IP of your Firebase hosting and the Port where the Firebase hostings are listening to, then Create.
Finish creating the backend service using the the Internet network endpoint group that you created as Backend Type
Under Host and Path rules. click +Add Host and Path Rule, please fill out the Host field with the domain of your Firebase hosting. For Path, just put /*. Then select the Internet network endpoint group that you created as Backend.
I am also under the assumption that your Google Managed Certificate is also deployed within the Load Balancer. If this is the case, then you may provision another Google Managed SSL certificate and include all 4 domains
example.com
dev.example.com
api.example.com
dev-api.example.com
Once done, you may create A records with the Load Balancer's IP address for each domain. This is to ensure that the requests will be forwarded to the correct backend, as oppose to just creating CNAME's which will always forward the request to the root domain (example.com) and not to their intended backends. The LB should be able to forward requests based on the domain being accessed.

Make firebase domain point to EC2 GCP Instance Ip Address

I am having a domain from firebase hosting that looks like this below
discourse-314707.web.app
I am also having an EC2 instance with the following ip address below
54.163.205.15
how can i make "discourse-314707.web.app" in firebase hosting to point to "54.163.205.15" in my EC# instance for example if i have installed an apache it displays the apache page
The discourse-314707.web.app is a subdomain on Firebase's web.app domain that it automatically sets up for any Firebase project.
Since the DNS for all web.app subdomains is managed by Firebase itself, there is no way for you to configure this to point to your own IP address.
The closest you can get it setting up your Firebase web site as a proxy for the one on EC2 with a micro-service. But you'll need to be on the paid plan for that, and it'll quite some hassle for the auto-generated subdomain.
If you register your own domain for the web app, you control the DNS settings for that domain and can point to whatever hosting service you want.

Google domain setup on GCP VM with nginx.?

Google domain name pointing at external IP of GCP compute engine with nginx installed and app in /var/www/html. Have google site verification of property code. I need HTTPS setup. Do I need Lets Encrypt? Why is it so difficult to establish HTTPS?
None of the dozens of sites nothing here in tag search or on GCP. Nginx has how to setup in /etc/nginx/nginx.conf but my site is visible http using my external IP but not the HTTPS domain name.

Azure VM DNS - What to specify as 'NS' and 'A' record

I have created virtual machine in Azure with static IP. I specified a DNS Name in my ResourceGroup called somevm. So Azure automatically made it somevm.southeastasia.cloudapp.azure.com
Then I added endpoint on public port 80, so the website can be accessed via localhost, via http:// ipaddress/ (outside of VM) and http://somevm.southeastasia.cloudapp.azure.com
On my existing hosting provider, I see the following DNS entries.
NS ns1.myhost.arvixevps.com
NS ns2.myhost.arvixevps.com
A <ipaddress>
* A <ipaddress>
www A <ipaddress>
mail A <ipaddress>
mail2 A <ipaddress>
MX [10], mail.mywebsite.com
MX [21], mail2.mywebsite.com
TXT globalsign-domain-verification=SKFHKSJHDLKUERIJKDCFJLKF_234KJFDJK
I want to migrate my website from Existing hosting to the Azure VM.
What do I need to enter in NS, and 'A' records. Do I also need to enter CNAME? If yes, what will it be and how to find it for my Azure VM.
Everything you need to be able to configure your domain for Azure Virtual Machine is here including CNAME/A records difference and what do you need to put on your domain registrar site. The reason that i added the link for the Cloud Service is that virtual machines in a classic mode (if you created that VM) reside in the specific entity called Cloud Service.
If you created the new Azure VM, then you could go with the Azure DNS service or that approach.
So, CNAME is basically the alias for the azure domain, and you may see the first domain. With A, the domain maps to the IP address of the resource instead of the domain. The choice depends on your scenario. The simplest way is to configure CNAME because if you configure A, you will need to configure static IP (or, because of the dynamic nature of a cloud, it may change in a future, so you will need to change it on your domain registrar site).
Some useful links for understanding how things are working here:
https://azure.microsoft.com/en-in/documentation/articles/dns-domain-delegation/
https://azure.microsoft.com/en-in/documentation/articles/dns-operations-recordsets/
http://blogs.msdn.com/b/cloud_solution_architect/archive/2015/05/05/creating-azure-vms-with-arm-powershell-cmdlets.aspx

Resources