【nginx/apache】远古技术:增加网站访问密码(auth_basic)
实现这种效果,首次打开某个网页的时候要求输入账号密码
如果不输入或输入错误,会提示
Unauthorized
This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.
我知道这种授权交互这并不优雅毫无设计可言,但应用于部署在公网的内部系统缺不失为一个简陋但有效的一道安全屏障。
以下是nginx和apache的实现流程概要(centos下为例):