VPS侦探论坛

 找回密码
 注册
查看: 6788|回复: 5

[Apache] autoindex不能成功

[复制链接]
发表于 2014-1-20 10:14:51 | 显示全部楼层 |阅读模式

在/usr/local/nginx/conf/nginx.conf中添加 autoindex on; 未能成功开启目录浏览
在具体的域名.conf中添加也是的。

请问如何破?!
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2014-1-20 10:55:07 | 显示全部楼层


啥错误信息,连个测试的地址都没有,我能咋说
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2014-1-20 10:59:55 | 显示全部楼层

回复 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 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2014-1-20 14:10:31 | 显示全部楼层



https://www.vpser.net/build/nginx-autoindex.html
地方加错了,要加到到目录浏览的location里,如果是一个虚拟主机的话就直接加到server段里
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2014-1-20 14:19:07 | 显示全部楼层

回复 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中?

军哥运维代购:http://shop63846532.taobao.com/

发表于 2014-1-20 16:26:07 | 显示全部楼层

回复 5# 的帖子


。。。。只能说明你没仔细看教程,你哪个需要就加到哪

如果一个域名你要直接列目录,root下面直接加,重启生效。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-5-7 02:36 , Processed in 0.029332 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表