| 代码如下 | 复制代码 |
| server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root /root/html; index index.html index.htm; } } |
|
系统中的路径查询结果:
| 代码如下 | 复制代码 |
|
[root@lizhong html]# ll /root/html/ |
|
目录时存在,重启nginx还是这个错误,后来想到是不是权限问题?于是在nginx.conf头部加入一行:
| 代码如下 | 复制代码 |
|
user root; |
|
重启nginx再访问,就可以正常访问了