Question

nginx default page

i open server through ip not has domain yet! when i open ip in browser i get nginx default page before i install it. after install nginx still get default page . i remove default file from site available and still show nginx welcome


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.

alexdo
Site Moderator
Site Moderator badge
June 27, 2024

Heya, @husseinahmed

You can test your Nginx configuration for syntax errors:

sudo nginx -t

The next step will be to reload Nginx to apply the changes:

sudo systemctl reload nginx

Also, ensure your firewall allows HTTP traffic. For example, if you are using UFW, run:

sudo ufw allow 'Nginx Full

Now you should see the content of your custom index.html file instead of the Nginx default welcome page.

Regards

Bobby Iliev
Site Moderator
Site Moderator badge
June 26, 2024

Hi there,

After removing the default Nginx server block, did you restart the Nginx service?

sudo systemctl reload nginx

Every time you make a change to the Nginx configuration, you would need to restart the Nginx service.

It is a good practice you first do a config test with nginx -t and only if you get Syntax OK then proceed with the restart.

Let me know how it goes.

- Bobby

Try DigitalOcean for free

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

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

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

Become a contributor

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

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