Welcome! Log In Create A New Profile

Advanced

Re: Is there a method to allow a particular user agent access to a server rule that uses the access and auth basic module?

Zev Blut
September 02, 2011 05:36AM
Hello,


On 09/02/2011 05:31 PM, Maxim Dounin wrote:
> On Fri, Sep 02, 2011 at 04:27:08PM +0900, Zev Blut wrote:

>> We have a use case were we need to allow an external agent to have
>> access to this site.
>> I'd rather not play whack-a-mole and keep adding ip addresses for this
>> agent.
>> At the same time I cannot give the agent an login and password, because
>> we can't control the URLs.
>>
>> So I was wondering if there is a way to also allow access to this
>> site based on the user agent?
>>
>> I tried using an if directive but that is not working.


> Alternatively, you may use auth request module[1] and write something
> like this:
>
>
> server {
> ...
>
> location / {
> satisfy any;
>
> allow ...
> auth_basic ...
> auth_request /auth;
> }
>
> location = /auth {
> if ($http_user_agent ~ something) {
> return 200;
> }
> return 403;
> }
> }
>
> [1] http://mdounin.ru/hg/ngx_http_auth_request_module/

Thanks for the link to the auth request module
That might serve my purposes best without have to refactor and duplicate
my configs as much as the extra location will.

Thanks,
Zev

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Is there a method to allow a particular user agent access to a server rule that uses the access and auth basic module?

Zev Blut September 02, 2011 03:28AM

Re: Is there a method to allow a particular user agent access to a server rule that uses the access and auth basic module?

Maxim Dounin September 02, 2011 04:32AM

Re: Is there a method to allow a particular user agent access to a server rule that uses the access and auth basic module?

Zev Blut September 02, 2011 05:36AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 89
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready