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.
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!
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
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
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
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.