I created a droplet and deployed a nextjs project. The IP address displays the content as expected.
I then tried to connect it to a domain name. However, the domain name only displays “welcome to nginx…If you see this page, the nginx web server is successfully installed and working. Further configuration is required.”
The DNS records show that hostname have the value of digitaloccean.com.
Any tip or reference as of what am I’m doing wrong would be highly welcomed.
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.
Hello,
On top of what has already been mentioned, I’ll share this article on How to set up Nginx virtual hosts. The article mentions an old version of Ubuntu but the process is relatively the same for Ubuntu 22.04
https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-16-04
Additionally, you can use our NginxConfig tool to generate the desired config file for your site.
https://www.digitalocean.com/community/tools/nginx
Hope that this helps!
Hey @leacards,
You need to configure your Nginx to accept your domain name. Most probably, you are using the normal configuration.
If you want to use your domain to proxy requests to your nextJS project with Nginx follow these steps:
SSH into your droplet and create a new Nginx configuration file for your domain:
Replace
mydomain.com
with your actual domain name. Add the following configuration, adjusting theserver_name
andproxy_pass
values accordingly:To enable the new configuration, create a symbolic link to it in the
sites-enabled
directory:Again, you’ll need to change the domain to the domain you wish to use.
If you wish to use a standard Nginx configuration, repeat all the steps above but for the config file use this: