I have a domain example.com that I use for the frontend of my application, hosted on Vercel. I’ve passed the DNS records provided by Vercel to my registrar (Squarespace). If I access example.com the frontend is being displayed.
Now, I have a droplet for the backend of my application which for now only has some dependencies and Nginx installed. If I visit http://droplet-ip the default Nginx page is displayed. How can I achieve the same behaviour by visiting http://api.example.com ?
I’ve added a new DNS record to Squarespace:
But for some reason when I try to visit http://api.example.com it redirects me to https://api.example.com and a Vercel specific error is being displayed “Deployment not found”. What am I doing wrong here?
I did not modify any NS and if I use the DNS lookup tool (https://www.digitalocean.com/community/tools/dns) to search for api.example.com it displays Owner: DIGITALOCEAN
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Heya @dragos1412,
First, you need to make sure your DNS is working properly. Try to do a ping
Does it return your Droplet’s IP address? If, yes, then good!
As for Nginx, you need to configure your api.example.com domain in your Nginx configuration. Check the following docs :
https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-22-04#step-5-setting-up-server-blocks-recommended
It should help with what you need.