除了那些本地网络上的nginx认证 [英] Nginx authentication except those on local network

查看:116
本文介绍了除了那些本地网络上的nginx认证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆