Warning: include(/www/wwwroot/399s.com/wp-content/plugins/wpjam-basic/public/wpjam-route.php): failed to open stream: No such file or directory in /www/wwwroot/399s.com/wp-content/plugins/wpjam-basic/wpjam-basic.php on line 34

Warning: include(): Failed opening '/www/wwwroot/399s.com/wp-content/plugins/wpjam-basic/public/wpjam-route.php' for inclusion (include_path='.:') in /www/wwwroot/399s.com/wp-content/plugins/wpjam-basic/wpjam-basic.php on line 34
使用htpasswd实现Nginx验证访问 – Hugo.Linの生活志

使用htpasswd实现Nginx验证访问

通过在线 htpasswd 生成器来实现Nginx验证访问。

接下来在Nginx配置文件中(通常是server段内),加入如下两行,并重载Nginx(service nginx reload)即可生效。

auth_basic "Please input password"; #这里是验证时的提示信息 auth_basic_user_file /home/passwd;

访问测试
再访问站点,提示需要输入用户名和密码才可以访问,此方法适合不宜公开的站点,比如PHPmyadmin,这样可避免被弱口令扫描,无疑再上了一把锁。

发表回复

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

返回主页看更多
狠狠的抽打博主 支付宝 扫一扫