Loading

Nginx常见文件

问题1(文件路径分隔符不正确)

查看nginx的error.log错误日志

2021/09/30 10:36:57 [crit] 17824#19388: *61 GetFileAttributesEx() "D:\site
ginx_web" failed (123: The filename, directory name, or volume label syntax is incorrect), client: 127.0.0.1, server: 127.0.0.1, request: "GET / HTTP/1.1", host: "127.0.0.1:8001"

原始配置

	server {
		listen	8001;
		server_name 127.0.0.1;
		
		location ~* / {
			root D:\site\nginx_web;
			index index.html;
		}
	}

问题原因是使用了错误的目录分隔符,应该使用/

改成

	server {
		listen	8001;
		server_name 127.0.0.1;
		
		location ~* / {
			root D:/site/nginx_web;
			index index.html;
		}
	}

问题解决了。

posted @ 2021-09-30 10:41  IT搬瓦工  阅读(78)  评论(0编辑  收藏  举报