VPS侦探论坛
标题:
autoindex不能成功
[打印本页]
作者:
wrchiu
时间:
2014-1-20 10:14
标题:
autoindex不能成功
在/usr/local/nginx/conf/nginx.conf中添加 autoindex on; 未能成功开启目录浏览
在具体的域名.conf中添加也是的。
请问如何破?!
作者:
licess
时间:
2014-1-20 10:55
啥错误信息,连个测试的地址都没有,我能咋说
作者:
wrchiu
时间:
2014-1-20 10:59
标题:
回复 2# 的帖子
zjq.in
没任何提示错误nginx.conf
===============================================
listen 80;
server_name www.lnmp.org;
index index.html index.htm index.php;
root /home/wwwroot/default;
location ~ .*\.(php|php5)?$
{
try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fcgi.conf;
autoindex on;
}
[
本帖最后由 wrchiu 于 2014-1-20 11:02 编辑
]
作者:
licess
时间:
2014-1-20 14:10
https://www.vpser.net/build/nginx-autoindex.html
地方加错了,要加到到目录浏览的location里,如果是一个虚拟主机的话就直接加到server段里
作者:
wrchiu
时间:
2014-1-20 14:19
标题:
回复 4# 的帖子
location ~ .*\.(php|php5)?$
{
try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fcgi.conf;
autoindex on;
}
location /status {
stub_status on;
access_log off;
autoindex on;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
autoindex on;
}
location ~ .*\.(js|css)?$
每个location中都加了,还是不行。
是添加入nginx.conf还是具体每个域名的config中?
作者:
licess
时间:
2014-1-20 16:26
标题:
回复 5# 的帖子
。。。。只能说明你没仔细看教程,你哪个需要就加到哪
如果一个域名你要直接列目录,root下面直接加,重启生效。
欢迎光临 VPS侦探论坛 (https://bbs.lnmp.com/)
Powered by Discuz! X3.4