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;

【Ngin配置允许访问文件目录】完整配置
server { listen80; 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_headerson; access_loglogs/walmart.access.logcombined; charset utf-8,gbk; location / { autoindex on; autoindex_exact_size off; autoindex_localtime on; root/www/wwwroot/www.walmart.com; indexindex.html index.htm; }}

    推荐阅读