// 修改 Nginx 配置及重启
vi /usr/local/nginx/conf/nginx.conf
/usr/local/nginx/sbin/nginx -s reload
phpMyAdmin 很方便管理MySql,但安全比方便更重要。#Nginx里设置目录访问权限#
# vi /usr/local/nginx/conf/nginx.conf / * 加入 */
location ^~ /phpMyAdmin4/ {
location ~ .*\.(php|php5)?$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
auth_basic "Auth Access";
auth_basic_user_file /thefolder/htpasswd/.htpasswd;
}
# vi /thefolder/htpasswd/.htpasswd / *内容如下 */
yname:encrypted-code
php: $encrypted-code = crypt($password, base64_encode($password));