关于nginx:Ngin配置允许访问文件目录

location中配置如下

location / {
    # 容许拜访文件目录
    autoindex on;
    # 按MB、GB展现文件大小, 配置on则按bytes展现文件大小
    autoindex_exact_size off;
    # 应用本地工夫
    autoindex_localtime on;
    # 文件门路
    root   /www/wwwroot/www.walmart.com;
}

server中配置编码

charset utf-8,gbk;

残缺配置

server {
    listen       80;

    server_name www.walmart.com;
    root /www/wwwroot/www.walmart.com;
    index index.html index.htm default.php default.htm default.html;
    #charset koi8-r;
    gzip on;
    gzip_buffers 32 4K;
    gzip_comp_level 6;
    gzip_min_length 2K;

     # 容许音讯头带_下划线
     underscores_in_headers  on;

    access_log  logs/walmart.access.log  combined;

    charset utf-8,gbk;

    location / {
        autoindex on;
        autoindex_exact_size off;
        autoindex_localtime on;
        root   /www/wwwroot/www.walmart.com;
        index  index.html index.htm;

    }

}

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理