记录一次nginx 403错误

前言:因为项目是前后端分离的,故需要nginx将请求转发访问,在一个周末完毕之后,启动nginx竟然页面竟然报403
在这里插入图片描述
便开始了排错之旅。
第一步当然是百度了,说出现这个的原因是没有权限(心里很纳闷,为什么我过了个星期天权限没了?),接着,便重启了电脑,发现还是说没有权限(这下真的有错误了)
第二步继续百度出现这个错误的原因,看了两篇发现看不懂,但有一个中提到,看nginx报错日志,那么好打开日志后找到今天报错的日志,进行分析,日志如下

2019/09/23 14:18:06 [error] 2020#20160: *1 directory index of "E:\distg/" is forbidden, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "localhost:9112"
2019/09/23 14:18:06 [error] 2020#20160: *2 CreateFile() "C:\Users\ASUS\Desktop\nginx-1.12.2/htmllast" failed (2: The system cannot find the file specified), client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "localhost:9112"
2019/09/23 14:18:16 [error] 2020#20160: *1 directory index of "E:\distg/" is forbidden, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "localhost:9112"
2019/09/23 14:18:16 [error] 2020#20160: *2 CreateFile() "C:\Users\ASUS\Desktop\nginx-1.12.2/htmllast" failed (2: The system cannot find the file specified), client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "localhost:9112"
2019/09/23 14:20:41 [error] 4176#10624: *1 directory index of "E:\distg/" is forbidden, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "localhost:9112"
2019/09/23 14:20:41 [error] 4176#10624: *1 CreateFile() "C:\Users\ASUS\Desktop\nginx-1.12.2/htmllast" failed (2: The system cannot find the file specified), client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "localhost:9112"
2019/09/23 14:21:11 [error] 4176#10624: *1 directory index of "E:\distg/" is forbidden, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "localhost:9112"
2019/09/23 14:21:11 [error] 4176#10624: *1 CreateFile() "C:\Users\ASUS\Desktop\nginx-1.12.2/htmllast" failed (2: The system cannot find the file specified), client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "localhost:9112"
2019/09/23 14:35:17 [error] 17032#17088: *1 directory index of "E:\distg/" is forbidden, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "localhost:9112"

简单的用超强的英语翻译了一下(其实是用谷歌哈哈),原因说是系统找不到指定的文件,立马心里说不可能,我文件位置放的一定没有问题,结果一看还真是文件放错位置了,一句真香结束心里的奔腾

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值