What is 403nginx

(*-*)浩
Release: 2019-07-31 13:43:16
Original
4473 people have browsed it

The reason why nginx reports a 403 error when accessing.

What is 403nginx

1. Due to the inconsistency between the startup user and the nginx working user

Check the startup user of nginx and find that it is nobody, but the

command started with root: ps aux | grep "nginx: worker process" | awk'{print $1}'

Change the user of nginx.config to and The starting user is the same,

command: vi conf/nginx.conf

2. The index.html or index.php file is missing, which is the index index.html in the configuration file The file specified in the index.htm line.

  server {  
     listen       80;  
     server_name  localhost;  
     index  index.php index.html;  
      root  /data/www/;
    }
Copy after login

If there is no index.php or index.html under /data/www/, if you directly file the file, 403 forbidden will be reported.

3. Permission issues. If nginx does not have the permission to operate the web directory, a 403 error will also occur.

Solution: Modify the read and write permissions of the web directory, or change the startup user of nginx to the user of the directory, and restart Nginx to solve the problem

chmod -R 777 /data
chmod -R 777 /data/www/
Copy after login

More Nginx related technical articles, Please visit the Nginx usage tutorial column to learn!

The above is the detailed content of What is 403nginx. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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