I am not able to change the directory for the domain. it is working for IP but not for domain linked via DNS. when i open the domain, it is always loading default file in /var/www/html. i tried steps from below URL.
any help would be appreciated.
TIA :)
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!
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.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Heya @09c265c50be54e97be17bc554e6068,
Have you created a separate nginx config for your Domain? In that config you need to specify a
server_name
which would be your Domain:After having a separate config for your Domain with the above, then loading your Domain should point you to the right directory.
You can check more here:
https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-20-04#step-5-setting-up-server-blocks-recommended