Question

I found my new index.html is /usr/share/nginx/html instead var/www/html.

I just use ‘sudo restart’ because in command prompt alert ‘New version require to restart’.After use sudo restart, my website show ‘Welcome to nginx!’. I found my new index.html is /usr/share/nginx/html instead var/www/html. The new location can’t open localhost. I want to redirect it.


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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi @sittiphansittisak,

You can update any of your settings from your nginx configuration files. You can find them at /etc/nginx.

As far as I understand, you are using your IP address to open your website, is that correct, or are you using your domain name?

If you are using your IP Address to open our website, what I suggest is to open your default configuration file, which you can find at /etc/nginx/sites-enabled/ and edit the root path so that it looks at the proper directory.

If you are using a domain name, you can again take a look at /etc/nginx/sites-enabled/ however the file should be YourDomain.conf from there you can make your changes.

Don’t forget to restart Nginx afterward

service nginx restart