#180304Nginx出现403 forbidden的问题
2018-03-04 23:10
323 查看
出现问题
查auth_basic_user_file
auth_basic_user_file指定的目录/usr/local/nginx/conf/htpasswd
解决方案
[root@localhost ~]# curl -uuser:123 -x127.0.0.1:80 test.com <html> <head><title>403 Forbidden</title></head> <body bgcolor="white"> <center><h1>403 Forbidden</h1></center> <hr><center>nginx/1.8.0</center> </body> </html>
查auth_basic_user_file
[root@localhost ~]# vi /usr/local/nginx/conf/vhost/test.com.conf 1 server 2 { 3 listen 80; 4 server_name test.com; 5 index index.html index.htm index.php; 6 root /data/wwwroot/test.com; 7 8 location / 9 { 10 auth_basic "Auth"; 11 auth_basic_user_file /usr/local/nginx/conf/htpasswd; 12 } 13 }
auth_basic_user_file指定的目录/usr/local/nginx/conf/htpasswd
查命令历史 [root@localhost ~]# htpasswd -c -m /data/.htpasswd user New password: Re-type new password: Adding password for user user
解决方案
[root@localhost ~]# rm -f /data/.htpasswd [root@localhost ~]# htpasswd -c /usr/local/nginx/conf/htpasswd user New password: Re-type new password: Adding password for user user [root@localhost ~]# /usr/local/nginx/sbin/nginx -s reload [root@localhost ~]# curl -uuser:123 -x127.0.0.1:80 test.com test.com
相关文章推荐
- (转)wamp2.5虚拟主机VirtualHost出现403 Forbidden问题解决
- 关于nltk download 出现http error 403 Forbidden 问题
- windows下kibana源码用dev模式启动,出现403 forbidden问题
- apache服务出现Forbidden 403问题的解决方法总结
- apache服务出现Forbidden 403问题的解决方法总结
- Apache服务出现Forbidden 403的问题总结
- apache服务出现Forbidden 403问题的解决方法总结
- 安装wamp,提示丢失msvcr110.dll文件 ,安装好后出现 403 forbidden问题的解决
- 登陆126邮箱 出现 403 Forbidden 腾达路由器问题
- Mac 环境下 基于CI框架 Apache 403 Forbidden 问题
- Python 3.x 中"HTTP Error 403: Forbidden"问题的解决方案
- hihoCoder- 403 Forbidden(Trie树问题 C解决)
- 阿里云服务器公网ip访问Apache服务器出现403 Forbidden
- Apache访问index.html总是出现403 Forbidden错误的解决方案
- SVN问题:Server sent unexpected return value (403 Forbidden) in response to OPTIONS
- 更改Nginx网站根目录以及导致的403 forbidden问题解决
- 部署apache服务Forbidden 403问题小结
- Mac 环境下 基于CI框架 Apache 403 Forbidden 问题
- Apache2安装后出现403 Forbidden 的原因[zt]
- svn: E170001: MKACTIVITY of报错问题解决和 POST 于 '/svn/.../!svn/me': 403 Forbidden