Question

I moved the default "hello.js" files in an archive folder and moved my React App build in the var/www/html folder but I see no changes

I followed the steps Sammy the shark showed me regarding the “Get your code on here” section of the default landing page

  • Launch your app by calling pm2 start <your-file>, then map the port your app runs on to an HTTP URL by running nano /etc/nginx/sites-available/default and adding another location. Use the existing entry for the port 3000 “hello” app as a basis.
  • Call sudo systemctl restart nginx to enable your new nginx config.
  • Call pm2 save to schedule your code to run at launch.

I expected to at least see an error message because I moved the “hello.js” and “index.nginx-debian.html” files into another directory but I still see the “Sammy welcomes you to your droplet” page when I visit my domain.

here is what my /var/www/html/archive directory looks like (where I moved the old files) image alt text

and here is what’s in my /var/www/html/ directory (populated with my react app build files)

image alt text
image caption

and this is my default “sites-available” file. I left it unchanged since I didn’t need to change the destination it was pointing to

image alt text
image caption

I’m very new at this and I’m learning a lot about how a website is hosted and served. But I’m not sure if I did something wrong or if I missed a step.

How is my domain still loading the default digitalocean landing page when I moved it to another directory? and why are my new react app build’s index.html file not being detected?

(my droplet is running Node JS on Ubuntu 20.04)


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.

Bobby Iliev
Site Moderator
Site Moderator badge
March 26, 2025

Hey there 👋

Quick check, are you trying to serve a React static site or are you running a full Node.js backend too?

If it’s just a React frontend (like after npm run build), you don’t need PM2 or a Node process running. You can just let Nginx serve the static files directly from /var/www/html. Running the React dev server in production is not recommended.

Make sure your Nginx config has something like:

location / {
    root /var/www/html;
    index index.html;
    try_files $uri $uri/ /index.html;
}

Then restart Nginx:

sudo systemctl restart nginx

If you’re using a Node backend (like Express or Vite SSR), that’s when PM2 and the proxy_pass setup to port 3000 makes sense.

Let me know how it goes!

- Bobby

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.