除了那些本地网络上的nginx认证 [英] Nginx authentication except those on local network
问题描述
从Apache2的一个特点,我不能做到即将;只需要外部访问,但免费用户访问我的本地网络上的身份验证。
任何想法如何轻松处理这种情况?
Coming from apache2 one feature I can not achieve; require authentication only to external access but free access to users on my local network. Any ideas how to handle easily this scenario?
任何帮助将是AP preciated。
Any help would be appreciated.
推荐答案
的我已经删除了我的previous答案,并想建议我在下面提供了一个解决方案的
我做了一些搜索,发现这个问题的解决方案 - 在code,在您使用 auth_basic
指令,进行必要的修改:
I did a little search and found this solution to your problem - In code, where you use auth_basic
directive, make such changes:
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
如何工作? 满足
指令意味着任何
或所有
从明年即将访问规则必须被传递给访问的资源。你可以在这里找到更多的细节:满足
How it works? satisfy
directive implies that any
or all
from next coming access rules must be passed to give access to resource. You can find more details here: satisfy
这应该完全适合你的问题。)
This should fit your problem perfectly ;)
这篇关于除了那些本地网络上的nginx认证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!