how to point multiple domains to the same website? - firebase

test.com DNS to cloudflare and I configured the www A record to point to google firebase. all good here.
I want to point any domain to www.test.com and render exactly the same content. what should I do to achieve this? do I need to create my own DNS in cloudflare and give it to domain admins so they can configure the domain? any pointers will help. thanks!

Providers like Firebase Hosting use the Host header name of the incoming request to determine which customer's content to serve. If other people change their DNS to point to www.test.com, the Host header will still be populated based on the domain they provided.
To make a website serve the same content regardless of domain, you need to either:
Host the content on a dedicated IP address such that the Host header doesn't matter (this is not possible with Firebase Hosting) or
Have all connecting domains proxy to www.test.com as opposed to directly setting DNS and include a Host header of www.test.com when they forward traffic.
In general services where you need to manually configure a custom domain (e.g. Firebase Hosting, Heroku, etc) are not going to support arbitrary other domains pointing to them without an additional layer in between.

Related

WP site accessible at subpath of domain used by Squarespace site

Alright this is a super weird request and it's just a stopgap measure until the client cleans up their many web properties, so no need to tell me that it's a convoluted way to do things. Current setup:
example.com is registered with GoDaddy but points to a Squarespace
site (CNAME & A records, etc)
sub.example.com is a Wordpress site on Godaddy hosting
Question: Can I make the WP site at sub.example.com instead appear as example.com/sub? If so, how?
I can set the site_url and home_url in WP, and I can set up a forwarding rule from Squarespace to the IP of the GoDaddy shared hosting account. Would that be enough?
I had thought I would need to set an A record with the host as example.com/sub, but slashes aren't allowed. Any insight greatly appreciated. Thanks for reading!
the only way to get this done that I am aware, is to use some form of land balancer, e.g.:
AWS Elastic Load balancer
Nginx / apache proxy
AWS CloudFormation custom backends
last option will also speed up your site.
Unless your DNS provider have some custom option, DNS alone can't do that.

How to setup AWS cloudfront with lightsail for WordPress?

How to setup AWS cloudfront with lightsail for WordPress? (on a subdomain)
I'm using Route 53 for all DNS management. I'm using a static IP from
lightsail, 3.122.2.187
Route 53 has an A record for service.openinfo.nl using an ALIAS to the cloudfront domain name.
Route 53 has an A record for wordpress.openinfo.nl pointing to the
lightsail static IP 3.122.2.187
Cloudfront has an origin domain name of wordpress.openinfo.nl
Cloudfront Origin Protocol Policy is HTTP Only.
Cloudfront Alternate Domain Names is service.openinfo.nl
Cloudfront SSL Certificate is the one issued by Route53 for *.openinfo.nl
Cloudfront Viewer Protocol Policy is Redirect HTTP to HTTPS.
This solution does not work:
The cloudfront distribution service.openinfo.nl does resolve the lightsail server but over http, it does not use the certificate I attached... Should I use redirect http to https?
Also, if I click 'login' it redirects to wordpress.openinfo.nl/wp-login.php i.e. the DNS that I assigned for the purpose of orgin domain name to cloudfront. The WordPress "WP_SITEURL" and "WP_HOME" settings somehow automatically reflect the DNS wordpress.openinfo.nl.
And also, the DNS name wordpress.openinfo.nl resolves the lightsail server (which I don't want because I want all trafic to the wordpress server to go via service.openinfo.nl). How to avoid this?
Background and what I tried:
My lightsail (WordPress) server does not show up in the "Origin Domain Name" dropdown list when creating a new distribution. So what should I do? The only AWS description on this topic that I can find is not clear on that to me.
Using the servers fixed IP address as "Origin Domain Name" in cloudfront is not allowed. So I created a DNS record in Route 53 (wordpress.openinfo.nl) to point to the static IP of my lightsail server. And I added this DNS record as "Origin Domain Name" in cloudfront (also including a https certificate *.openinfo.nl). And I selected the cloudfront distribution as A record, type alias, in Route 53. The cloudfront Alternate Domain Names (CNAMEs) is service.openinfo.nl .
So I also tried creating the service.openinfo.nl as A record (DNS) in Route 53 pointing to the static IP of the WordPress lightsail server. But then I cannot create the same service.openinfo.nl as alias A record...
So I am stuck... Please advice? Many thanks in advance! Wouter
PS: openinfo.nl points to a cloudfront distribution with a certificate which points to a static site in a S3 buckets and works fine.
https://aws.amazon.com/blogs/startups/how-to-accelerate-your-wordpress-site-with-amazon-cloudfront/
https://forums.aws.amazon.com/thread.jspa?threadID=264002
First of all, you need to point your domain to CloudFront. You will want to set up a CNAME record in your DNS zone, pointing to the xyz.cloudfront.net address you get when creating the CloudFront distribution. The name of that record should be "www.example.com" if that's the domain you want to enable CloudFront on. Making example.com (without www) work as well could be a bit more tricky as you can't use a CNAME for technical reasons. Route 53 offers a way around this, but the DNS management in Lightsail is a simpler version of that service essentially. But you can always add an A record for example.com, pointing to your server IP address. Then your server can redirect those requests (additional configuration needed).
Secondly, CloudFront needs to contact your server on some address. You could add a second record to your DNS zone. This time you call it "origin.example.com" (or anything really), make it an A record, and point it to the server IP address.

Hosting subdomain without a name domain nginx

I want to add a subdomain to my server. I do have have an ip address given by the hosting server but I don't have the name domain yet. Is it possible to host like:
subdomain.152.235.235.85 <-- I tried this by Is not working for me, perhaps this is not possible
Or is there a better way to have subdomain without having a name domain yet?
If you want use this site for few devices, you can add to file hosts your domain: 152.235.235.85 subdomain.test.site
But just add subdomain to IP is impossible.

Separate Domain Registrar and Host, possible to use CDN?

I am just wondering if this is possible/how I could go about doing this.
I work for a company that has their domain name registered on Site A while their hosting is on Site B. This is no issue as we just have the Registrar at Site A point the Name Servers to Site B. Easy.
Where I get a little confused, is say I would like to use a CDN such as CloudFlare (Site C), typically in a basic case, I would go to the registrar/host and just change my Name Servers to the ones given by CloudFlare. However if my Registrar and Domain Host are different, it appears someone could get lost in the mix, as if I go from Site A point to Site C .. how does host at Site B supply Site C with all the information to host and control the CDN for?
Thanks for the insight!
I reached out to CloudFlare and got this very simple, perfect answer.
Here's how it will work for you :
At your domain registrar, you will set your authoritative name servers to the ones that CloudFlare will assign to you when you sign up.
Within CloudFlare, using our dashboard, you will configure your DNS zone file to point your domain to the IP address of the server assigned to you by your hosting provider.
The CloudFlare reverse proxy does the rest!
Hope this helps!

How to connect domain to WordPress on Google Compute Engine

I already own a domain from BigRock.in
And I've deployed WordPress on Google Compute Engine (GCE)
I want to connect this domain to my WordPress installation. How do I do that?
And also if it's possible to connect domain to my WordPress installation, how to create subdomains on GCE?
Domains and subdomains are controlled via DNS. You need to make the DNS record for bigrock.in, www.bigrock.in or whatever other subdomain you want point to you GCE instance's IP address.
If you want different subdomains to show different sites you will need to set up virtualhosts in your HTTP server (or perhaps use a Wordpress plugin).

Resources