location ~ ^/ {
root /home/mirrors/;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
#auth_basic "secret"; #添加認證配置
#auth_basic_user_file /usr/share/nginx/passwd.db; #添加認證文件路徑
}
[root@stage19 /home/mirrors/gems] gem generate_index -d /home/mirrors/gems # 注意路徑
Generating Marshal quick index gemspecs for 27 gems
...........................
Complete
Generated Marshal quick index gemspecs: 0.013s
Generating specs index
Generated specs index: 0.001s
Generating latest specs index
Generated latest specs index: 0.000s
Generating prerelease specs index
Generated prerelease specs index: 0.000s
Compressing indicies
Compressed indicies: 0.000s
# 會生成以下文件和目錄
[root@stage19 /home/mirrors/gems] ls
gems latest_specs.4.8 latest_specs.4.8.gz prerelease_specs.4.8 prerelease_specs.4.8.gz quick specs.4.8 specs.4.8.gz
# 查看新生成文件的描述
gem generate_index -h