Welcome! Log In Create A New Profile

Advanced

Re: Forcing a Basic Dialog Box.

David
January 02, 2012 04:48AM
Fantastic.

That worked great. I didnt realize I needed the extra $more_headers package.

Appreciate your help.

Thank you!



On 1/1/12 11:13 PM, Piotr Sikora wrote:
> Hi,
> diff inline.
>
> Please note that you'll also need ngx_headers_more module:
> https://github.com/agentzh/headers-more-nginx-module
>
>> location / {
>> auth_basic "Restricted";
>
> -auth_basic "Restricted";
>
>> root /var/www/web/;
>> auth_request /auth;
>>
>> try_files $uri $uri/ @upstream;
>> }
>>
>>
>> location /auth {
>
> -location /auth {
> +location = /auth {
>
>> internal;
>>
>> postgres_escape $user $remote_user;
>> postgres_escape $pass $remote_passwd;
>>
>> postgres_pass database;
>> postgres_query "SELECT login FROM users WHERE
>> login=$user AND pass=$pass";
>> postgres_rewrite no_rows 403;
>
> -postgres_rewrite no_rows 403;
> +postgres_rewrite no_rows 401;
> +more_set_headers -s 401 'WWW-Authenticate: Basic realm="Restricted"';
>
>> postgres_output none;
>> }
>
> Best regards,
> Piotr Sikora < piotr.sikora@frickle.com >
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

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

Forcing a Basic Dialog Box.

David December 29, 2011 10:16PM

Re: Forcing a Basic Dialog Box.

Maxim Dounin December 30, 2011 06:52AM

Re: Forcing a Basic Dialog Box.

Sergey A. Osokin December 30, 2011 07:02AM

Re: Forcing a Basic Dialog Box.

Piotr Sikora January 01, 2012 11:14PM

Re: Forcing a Basic Dialog Box.

David January 02, 2012 04:48AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 192
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