美文网首页
【Nginx—常见故障集合】

【Nginx—常见故障集合】

作者: 杨丶子 | 来源:发表于2019-06-05 15:04 被阅读0次

1.Nginx服务没有运行

80端口没有开
重启nginx服务 systemctl restart nginx

image

2.查看详细Nginx错误提示 检查语法 nginx-t

一般宝花括号说明配置文件内容语法错误了

image

3./etc/hosts文件域名没有解析

image

4.server_name没有以分号结尾 ";"

treminated 结束
image

5.报错—404 找不到

站点目录可能没有创建,或者nginx.conf配置文件站点目录写错了
image

6.报错—403 权限拒绝

Forbidden 权限拒绝
image

模拟错误:站点目录权限修改为000 测试完后改回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.报错—403 首页文件不存在

首页文件不存在 默认是找首页文件
image

8. 无法分配制度的ip地址

本地没有10.0.0.9 的ip
10.0.0.9:80 (failedCannot assign)

9.nginx已经启动了,在使用80端口

只是提示,不是报错

image

相关文章

网友评论

      本文标题:【Nginx—常见故障集合】

      本文链接:https://www.haomeiwen.com/subject/rmfsxctx.html