how to connect a droplet to a domain name

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

Any tip or reference as of what am I’m doing wrong would be highly welcomed.

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Site Moderator
Site Moderator badge
April 25, 2023


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

Additionally, you can use our NginxConfig tool to generate the desired config file for your site.

Hope that this helps!

Site Moderator
Site Moderator badge
April 24, 2023

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:

  1. sudo nano /etc/nginx/sites-available/

Replace with your actual domain name. Add the following configuration, adjusting the server_name and proxy_pass values accordingly:

server {
    listen 80;

    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;

To enable the new configuration, create a symbolic link to it in the sites-enabled directory:

  1. sudo ln -s /etc/nginx/sites-available/ /etc/nginx/sites-enabled/
  1. systemctl restart nginx

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:

server {
    listen 80;
    root /var/www/;

    location / {
        try_files $uri $uri/ =404;
    error_page 404 /404.html;
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/html;

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

card icon
Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up
card icon
Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We’d like to help.

Learn more
card icon
Become a contributor

You get paid; we donate to tech nonprofits.

Learn more
Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand.

Learn more ->
DigitalOcean Cloud Control Panel
Get started for free

Enter your email to get $200 in credit for your first 60 days with DigitalOcean.

New accounts only. By submitting your email you agree to our Privacy Policy.

© 2023 DigitalOcean, LLC.