satisfy problem

Igor Sysoev igor at sysoev.ru
Mon Apr 11 14:11:58 MSD 2011


On Fri, Apr 08, 2011 at 12:16:34PM +0800, lhmwzy wrote:
> another problem:
> 
> when use:
>        location ^~ /ks/admin
>        {
>                satisfy any;
>                allow 10.68.136.241/32;
>                allow 10.66.23.80/32;
>                deny all;
>                auth_basic "passwd";
>                auth_basic_user_file ksadminpasswd;
>       }
> then the 401 error page can not be customized,only show the default
> 401error page:
> 
> "401 Authorization Required
> -------------------------------------------------------------------------------
> nginx/0.9.7
> ".

The attached patch should fix the bug.


-- 
Igor Sysoev
http://sysoev.ru/en/
-------------- next part --------------
Index: src/http/ngx_http_special_response.c
===================================================================
--- src/http/ngx_http_special_response.c	(revision 3886)
+++ src/http/ngx_http_special_response.c	(working copy)
@@ -557,10 +557,13 @@
             r->method_name = ngx_http_get_name;
         }
 
+        r->access_code = 0;
+
         return ngx_http_internal_redirect(r, &uri, &args);
     }
 
     if (uri.data[0] == '@') {
+        r->access_code = 0;
         return ngx_http_named_location(r, &uri);
     }
 


More information about the nginx mailing list