Nginx设置HTTP认证
来源:互联网 发布:编程电脑推荐 编辑:程序博客网 时间:2024/06/06 11:49
需要htpassword来创建和生成加密的用户用于基础认证,先安装apache2-utils
sudo apt-get install apache2-utils
创建用户名和密码:
sudo htpasswd -c /etc/nginx/.passwd user
命令行为提示你输入密码:
New password:Re-type new password:Adding password for user user
更新Nginx配置
在你的网站的Nginx配置文件增加如下两行:
auth_basic "Restricted";auth_basic_user_file /etc/nginx/.passwd;
重启nginx生效。
阅读全文
0 0
- Nginx设置HTTP认证
- Nginx HTTP缓存设置
- Nginx中使用htpasswd配置Http认证
- Nginx设置HTTP基本验证
- nginx设置http跳转https
- nginx设置HTTP响应头
- curl设置http头Authentication实现http基本认证
- nginx配置网站所有目录下文件http认证
- nginx用户认证配置( Basic HTTP authentication)
- nginx用户认证配置( Basic HTTP authentication)
- Nginx设置目录浏览(autoindex)、以及登录权限认证
- nginx用户认证配置( Basic HTTP authentication)及认证原理和实现
- Nginx:设置为HTTP代理服务器上网
- Nginx 设置Combo减少Http请求
- nginx 设置匿名http正向代理
- nginx 设置匿名http正向代理
- HTTP认证
- HTTP认证
- Ubantu系统安装搜狗输入法教程
- 五、ESP8266 之 UDP (基于LUA开发)
- MongoDB:1-MongoDB和Robomongo安装
- ZXing二维码扫描
- C++中虚析构函数的作用及其原理分析
- Nginx设置HTTP认证
- Servlet中的Request和Response
- C语言操作符的总结
- RecyclerView_
- Look Into Person数据集的错误!!
- MVC模式
- html 中的location部分方法
- C++之多态的原理及其分析
- 手机与SIM卡的组合关系