VPS侦探论坛

 找回密码
 注册
查看: 5399|回复: 3

nginx索引目录问题

[复制链接]
发表于 2013-11-8 20:49:17 | 显示全部楼层 |阅读模式

开启了索引目录之后(指定了一个新网站和wwwroot下的新目录)会有风险吗,比如说跨站风险
该目录的文件权限该如何设置?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2013-11-9 09:03:49 | 显示全部楼层


跨站应该不会,不过没解析的文件可能会被直接下载
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2014-4-21 10:56:40 | 显示全部楼层

回复 1# 的帖子


lnmpa 环境下是怎么实现开启索引目录的?
因为我做的内网服务器,所以没办法给出地址。
其中有一个目录是中文名称,有几千个文件,大都中文名,供内网用户方便下载使用!

修改/usr/local/apache/conf/httpd.conf 为

  1. DocumentRoot "/home/wwwroot/default"
  2. #
  3. # Each directory to which Apache has access can be configured with respect
  4. # to which services and features are allowed and/or disabled in that
  5. # directory (and its subdirectories).
  6. #
  7. # First, we configure the "default" to be a very restrictive set of
  8. # features.  
  9. #
  10. <Directory />
  11.     Options ExecCGI FollowSymLinks Includes IncludesNOEXEC Indexes -MultiViews SymLinksIfOwnerMatch
  12.     AllowOverride All
  13.     Order allow,deny
  14.     Allow from all
  15. </Directory>
复制代码


修改/usr/local/nginx/conf/nginx.conf 为
  1. listen       80;
  2.   server_name www.lnmp.org;
  3.   index index.html index.htm index.php;
  4.   root  /home/wwwroot/default;
  5.     autoindex on;
  6.     autoindex_exact_size off;
  7.     autoindex_localtime on;
复制代码


以上修改都没有作用,到底该怎么修改?

[ 本帖最后由 hsxxzn 于 2014-4-21 11:04 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2014-4-21 16:43:52 | 显示全部楼层
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-25 15:19 , Processed in 0.026140 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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