0%

nginx-问题

nginx-问题

nginx-问题

访问报错:

404 Not Found

image-20201019142343627

日志文件nginx.1.10.3/logs/error.log信息:

1
2020/10/19 14:05:51 [crit] 21512#26196: *3 CreateFile() "D:	estweb/index.html" failed (123: The filename, directory name, or volume label syntax is incorrect), client: 127.0.0.1, server: 127.0.0.1, request: "GET /index.html HTTP/1.1", host: "127.0.0.1:8850"

原因:

配置文件nginx.conf属性location中D:\test_web 路径含有\t,被解析为D: estweb/index.html

原配置文件:

1
2
3
4
location / {
root D:\test_web;
index index.html;
}

解决:

​ 修改配置文件

1
2
3
4
location / {
root D:/test_web;
index index.html;
}

测试:

image-20201019141335011