Home > Operation and Maintenance > Nginx > How to modify the nginx site root directory

How to modify the nginx site root directory

PHPz
Release: 2023-05-14 20:37:16
forward
2845 people have browsed it

1. Modify nginx configuration file

Command

vi /usr/local/nginx/conf/nginx.conf
Copy after login

Modify two places in it

How to modify the nginx site root directory

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 .
Copy after login

Use the ll command at the upper level to check the permissions if it is
          

How to modify the nginx site root directory

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!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template