[Collection] Nginx- common faults

1.Nginx service is not running

80 port is not open
to restart the service systemctl restart nginx nginx

16952149-d09b5c52b52239bd.png
image

2. Review the detailed error checking grammar Nginx nginx-t

Bao braces general description of the configuration file for syntax errors

16952149-08722306b92573a4.png
image

3./etc/hosts file does not resolve domain name

16952149-4b421eb0a2a674fa.png
image

4.server_name not end with a semicolon ";"

treminated end
16952149-3f46eaae8312ee1e.png
image

5. not found error -404

Site directory may not be created, or the configuration file nginx.conf wrong site directory
16952149-322377177f31d6f8.png
image

6. Permission Denied error -403

Forbidden Permission Denied
16952149-eb4c887515cf9e70.png
image

Analog Error: Site directory permissions changed to 000 after the test changed back to 644

[09:34 root@web01 ~]# ll  /usr/share/nginx/html/www/
total 4
-rw-r--r-- 1 root root 15 Jun  5 09:00 index.html
[09:35 root@web01 ~]# curl www.oldboy.com
<html>
<head><title>403 Forbidden</title></head>
<body>
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx/1.16.0</center>
</body>
</html>

7. The file does not exist error -403 Home

Home to find the file does not exist by default home page file
16952149-7dab371f5ca5a497.png
image

8. Unable to allocate system ip address

No local ip 10.0.0.9 of
10.0.0.9:80 (failedCannot assign)

9.nginx has been launched in the use of port 80

Just tips, not an error

16952149-71dcc8a3a069d74c.png
image

Reproduced in: https: //www.jianshu.com/p/74656ab9fa4b

Guess you like

Origin blog.csdn.net/weixin_34077371/article/details/91264385