Nginx: autoinagedex不起作用
大家好,我按照指南
https://www.youtube.com/watch?v=7QXnk8emzOU
并做了一切都同样的事情,我检查了其他类似的问题,如
https://serverfault.com/questi ... -work
和
https://serverfault.com/questi ... index
.
配置文件 nginx:
文件 html 位于地址
, 一
, 其他
. 我看到了内容 index.htm, 连接到服务器的IP地址时。
我依次更改了整个内容的权限,以避免先前权限的问题,如:
https://www.youtube.com/watch?v=7QXnk8emzOU
并做了一切都同样的事情,我检查了其他类似的问题,如
https://serverfault.com/questi ... -work
和
https://serverfault.com/questi ... index
.
配置文件 nginx:
server {
listen 80; #says to listen on standard port
server_name _; #the default server
location / { #location is the root of the site
root /test/a/; #root is located at /test/a/
index index.htm; #index is for autocomplete
autoindex on; #this way files will be autoindexed
}
}
文件 html 位于地址
/test/a
, 一
/test/a/index.htm
, 其他
/test/a/outdex.htm
. 我看到了内容 index.htm, 连接到服务器的IP地址时。
我依次更改了整个内容的权限,以避免先前权限的问题,如:
chmod 777 -R /test
没有找到相关结果
已邀请:
1 个回复
江南孤鹜
赞同来自:
指定将用作索引的文件,因为我刚刚放置一个文件,而不是目录,它是我在更改索引后唯一得到的东西,如下所示,我得到了我的预期。
来源:
http://nginx.org/en/docs/http/ ... .html
https://www.youtube.com/watch?v=7QXnk8emzOU