windows 下配置 Nginx 常见错误

如果启动失败 可以看下logs目录下 error.log 文件里的错误信息。

1.  端口占用问题

配置文件里服务侦听的是 80 端口,80端口如果被占用,把相关进程关闭就可以了,这个问题在错误日志里记录是这样的。

2015/01/15 10:44:12 [emerg] 8800#5988: bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket in a way forbidden by its access permissions)

碰到类似的错误,请确认端口是否被占用或被防火墙屏蔽

2.Nginx所在目录有中文

错误日志大致输出一下内容

2015/01/15 11:55:55 [emerg] 5664#8528: CreateFile() "E:\软件\nginx-1.7.8/conf/nginx.conf" failed (1113: No mapping for the Unicode character exists in the target multi-byte code page)

3. 启用缓存时报错

2015/01/15 17:26:50 [emerg] 17068#20356: shared zone "cache_one" has no equal addresses: 02CF0000 vs 02A20000
2015/01/15 17:26:50 [alert] 11536#11228: worker process 17068 exited with code 1

一直没有找到解决的方法,有人说重启服务,或者缓存设置大一点就可以了,试了一下没有用的,官网原文是这样讲的。

: The cache and other modules which require shared memory support do 
: not work in Windows Vista and later due to address space layout 
: randomization being enabled in these Windows versions.

你可能感兴趣的:(windows 下配置 Nginx 常见错误)