Ste*_*fan 5 authentication nginx basic-authentication
来自apache2的一个功能我无法实现; 要求仅对外部访问进行身份验证,但对本地网络上的用户进行免费访问.任何想法如何轻松处理这种情况?
任何帮助,将不胜感激.
我删除了之前的答案,并想建议我在下面提供的解决方案
我做了一点搜索并找到了解决问题的方法 - 在使用auth_basic指令的代码中,进行以下更改:
satisfy any;
allow 10.0.0.1/8; // give access for all internal request
deny all;
auth_basic "...."; // your auth_basic code goes here
auth_basic_user_file ...; // your auth_basic_user_file goes here
Run Code Online (Sandbox Code Playgroud)
这个怎么运作?satisfy指令意味着必须传递any或all来自下一个即将到来的访问规则才能访问资源.你可以在这里找到更多细节:满足
这应该完全适合你的问题;)
| 归档时间: |
|
| 查看次数: |
2694 次 |
| 最近记录: |