Question

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

  • Posted April 21, 2021
  • Nginx

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.

Subscribe
Share

Submit an 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.

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