Welcome! Log In Create A New Profile

Advanced

Re: satisfy problem

April 11, 2011 06:20AM
On Mon, Apr 11, 2011 at 02:11:58PM +0400, Igor Sysoev wrote:
> 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.

A new better patch.


--
Igor Sysoev
http://sysoev.ru/en/
Index: src/http/ngx_http_core_module.c
===================================================================
--- src/http/ngx_http_core_module.c (revision 3886)
+++ src/http/ngx_http_core_module.c (working copy)
@@ -1108,17 +1108,21 @@
ngx_http_core_post_access_phase(ngx_http_request_t *r,
ngx_http_phase_handler_t *ph)
{
+ ngx_int_t access_code;
+
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"post access phase: %ui", r->phase_handler);

- if (r->access_code) {
+ access_code = r->access_code;

- if (r->access_code == NGX_HTTP_FORBIDDEN) {
+ if (access_code) {
+ if (access_code == NGX_HTTP_FORBIDDEN) {
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
"access forbidden by rule");
}

- ngx_http_finalize_request(r, r->access_code);
+ r->access_code = 0;
+ ngx_http_finalize_request(r, access_code);
return NGX_OK;
}

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

satisfy problem

lhmwzy April 07, 2011 11:54AM

Re: satisfy problem

Francis Daly April 07, 2011 01:02PM

Re: satisfy problem

Thomas Love April 07, 2011 02:28PM

Re: satisfy problem

lhmwzy April 07, 2011 07:54PM

Re: satisfy problem

lhmwzy April 07, 2011 07:54PM

Re: satisfy problem

Oleksandr V. Typlyns'kyi April 07, 2011 08:10PM

Re: satisfy problem

lhmwzy April 08, 2011 12:18AM

Re: satisfy problem

lhmwzy April 08, 2011 12:56AM

Re: satisfy problem

Igor Sysoev April 11, 2011 06:14AM

Re: satisfy problem

Igor Sysoev April 11, 2011 06:20AM

Re: satisfy problem

lhmwzy April 11, 2011 10:52AM

Re: satisfy problem

lhmwzy April 11, 2011 10:50AM

Re: satisfy problem

lhmwzy April 11, 2011 11:02AM

Re: satisfy problem

ylshjx April 11, 2011 10:20PM

Re: satisfy problem

ylshjx April 11, 2011 10:29PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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