Deploy a nextjs app to vercel and point subdomain from cloudflare - next.js

I need to deploy a nextjs app to vercel and I am using cloudflare to manage the dns. I need to point dev.domain.com to vercel deployment. In vercel Project Settings-> Domains I have added the sub domain.
In cloudflare I have added the records as type: cname . name: dev content: cname.vercel-dns.com . In vercel it is showing valid configuration. When I tried to access the subdomain it says site cant be reached with error code as DNS_PROBE_FINISHED_NXDOMAIN

you need to add A record for your subdomain pointing to vercel ip.
Type: A
Name: dev
Content: vercel ip
make sure to switch off proxy status until vercel verifies your site

Related

How can I deploy a Next.js project to my main domain and install WordPress in a subdomain using Nginx on an AWS EC2 instance

I have a domain name, "mydomain.com", and I want to deploy a Next.js project to the main domain and install WordPress in a subdomain, "wp.mydomain.com". I need to accomplish this on an AWS EC2 instance using **Nginx **as the web server.
For the Next.js project, I have already built the project using npm run build. However, I'm not sure how to configure Nginx to serve the project from the root domain.
For WordPress, I need to know how to install and configure it in a subdomain using Nginx. Specifically, I need to know how to install PHP and MySQL, configure Nginx to serve the **subdomain **from the WordPress directory, and set up SSL using Let's Encrypt.
Can anyone provide detailed step-by-step instructions or point me to relevant documentation or tutorials for deploying Next.js and WordPress with Nginx on an AWS EC2 instance? Any help or guidance would be greatly appreciated!
I have already built the Next.js project using npm run build, and I have installed Nginx on my AWS EC2 instance. I have also set up the DNS records to point the domain and subdomain to my EC2 instance. However, when I try to access the root domain or the subdomain, I see an error message or a default Nginx page, instead of the expected content from the Next.js project or WordPress site.
I was expecting to see the content from my Next.js project when I visit the root domain, and the WordPress site when I visit the subdomain. I also want to make sure that the website is served securely over HTTPS using Let's Encrypt.

NextAuth redirects to localhost in AWSAmplify

My Nextjs website is hosted on AWS Amplify and is using NextAuth for authentication.
When i try to signin to my website, the callback redirect takes me to localhost instead of my domain.
I have verified the configuration and environment variables they all look good, the website works fine in my localhost.
What can be the reason for this issue.
I was able to resolve this issue with the below updates in amplify.yml
build:
commands:
- echo "NEXTAUTH_URL=$NEXTAUTH_URL" >> .env
Also make sure :
Your NEXTAUTH_URL has the right protocol as per your hosted website.
Its pointing to the right domain i.e www..com or .com
Reference
https://docs.aws.amazon.com/amplify/latest/userguide/environment-variables.html#access-env-vars

Migrating domain from WordPress to Heroku

I'm trying to connect a domain I bought through WordPress to a new site I'm hosting on Heroku.
I tried to follow the Heroku docs on custom domains but now I'm lost: www.mywebsite.com sends me to my new Heroku site, but mywebsite.com still directs me to the old WordPress.
What I've done already:
On wordpress, I initiated a domain transfer and received a transfer code (which I haven't figured out what to do with).
Then I ran on the command line
heroku domains:add www.mywebsite.com
heroku domains
...which showed me a xxxx.herokudns.com address
Finally I went back to WordPress.com and created a new CNAME record, as the Heroku docs specified
Type: CNAME
Name: www.mywebsite.com
Alias of: xxxx.herokudns.com
This is, I understand from the Heroku docs, the process to register a subdomain. I was unable to follow the procedure for a custom root domain as WordPress does not allow for ALIAS or ANAME records, and requires a subdomain for CNAMES. I also was unable to follow the procedure for a custom wildcard domain because the command failed on the command line
zsh: no matches found: *.mywebsite.com
Help! How do I make sure that users who don't enter the www before mywebsite.com arrive at the right site??

www subdomain points to a completely different project

I have the weirdest problem. I deployed my app to heroku and registered a domain name lets say: xyz.example . I tried to move to this URL and my project was there and working fine, then I tried to move to www.xyz.example and I get a completely different project that exist in my computer but have nothing to do with heroku and never have been deployed to there! Its a static website that has been uploaded to another domain using filezila a while ago. My domain provider is Domain.com. I tried to look there for answer in my domains list but nothing has changed and it's all looks fine. What can it be?
To connect your heroku hosting to your domain name,
you have to open your domain name account and in the DNS Management page add in the cname the host: www and in the point to: your heroku url And in the heroku page in the settings add three domains:
*.xyz.example
xyz.example
www.xyz.example
This should work :) Check this video https://www.youtube.com/watch?v=kKGSGT7mSnQ&feature=youtu.be

Is it possible to host site on meteor.com and have a naked domain from namecheap?

I've got a domain, freegreen.space, that I'd like to host on meteor.com as freegreen.space. I'd also like www.freegreen.space to redirect to freegreen.space. I've got two DNS entries, CNAME www origin.meteor.com and URL Redirect # http://www.freegreen.space. Is it possible to have www.freegreen.space redirect to freegreen.space, and host on meteor.com?
I haven't found a good way of doing this. Probably cause meteor.com isn't ment for production hosting.
What you can do though, is the following:
DNS
A: # 107.22.210.133
CNAME: www freegreen.space
Deployment
You need to do meteor deploy freegreen.space then meteor deploy www.freegreen.space
Now you will have 2 deployments of your website. It's ridiculous but it's a work around.

Resources