1、解决Nginx make: *** No rule to make target `build', needed by `default'. Stop.
(1)先将以前的make cleanlinux
(2)安装下面配置nginx
yum -y install make zlib-devel gcc-c++ libtool openssl openssl-devel
(3) 从新configurec++
./configure
(4) 编译windows
make && make install
2、HTTP Error 404.The requested resource is not found.
缘由是由于端口被占用。浏览器
(1)打开conf文件夹(G:\software\nginx-1.12.2\conf)ui
(2)打开nginx.confspa
(3)修改端口code
(4)用命令关闭并从新启动server
(5)在浏览器输入地址便可blog
3、An error occurred.
问题:
2020/10/07 21:26:49 [crit] 8964#22844: *2 GetFileAttributesEx() "G:\software
ginx-1.12.2\static" failed (123: The filename, directory name, or volume label syntax is incorrect), client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "localhost:10001"
缘由:windows和linux不同,windows中默认是反斜杠\\\,而linux确实斜杠// ,结果路径中的
G:\software ginx-1.12.2\static \n就会被当作换行,被转移处理
解决方案:配置资源目录的时候, root G:\software\\nginx-1.12.2\static; 双反斜杠表示不转义,若是是linux就不会存在这个问题。
4、403 Forbidden
directory index of “xxx“ is forbidden
缘由:直接使用IP地址和端口号访问时,须要指定index,若是未指定,出现该报错。
添加上autoindex on就能够了