nginx 开启目录浏览及密码访问

开启目录浏览:
location /dl
{
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
}

开启密码访问:
location = /wp-login.php {
auth_basic "HTTPS";
auth_basic_user_file /root/htpasswd;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index wp-login.php;
include fastcgi.conf;
}

htpasswd在线生成地址