Home > Article > Operation and Maintenance > How to modify the nginx site root directory
1. Modify nginx configuration file
Command
vi /usr/local/nginx/conf/nginx.conf
Modify two places in it
2. Many people have modified it This, I uploaded a file in the ftp tool, such as index.html, but it shows 404 not found
The only problem now is to modify the permissions of the folder. The access permissions of the folder are not enough, so accessing using IP or domain name is Inaccessible.
Solution; use the command to enter the root directory of your site and enter the command
chmod a+w .
Use the ll command at the upper level to check the permissions if it is
If it is the same as above, it is correct. It is best to set all superior directories of the website root directory to this permission. Otherwise, you may not have the root directory permissions Enough, the upper-level directory does not have enough permissions and may not be accessible. Therefore, it is best not to make the website root directory too deep.
The above is the detailed content of How to modify the nginx site root directory. For more information, please follow other related articles on the PHP Chinese website!