As to patch, after looking the code, I have found that EACESS at this
point should be ignored. Here is my patch (the same as Maxim’s one)
with comment. Could you or someone test English part of patch ?
i figured out - i need to use “p0” with your patches and they patch
directly. okay. first question resolved
2008/08/16 12:23:06 [debug] 8277#0: *34 open index
“/home/mike/web/192.168.1.3/index.5”
2008/08/16 12:23:06 [debug] 8277#0: *34 add cleanup: 00000000007FD948
2008/08/16 12:23:06 [debug] 8277#0: *34 open()
“/home/mike/web/192.168.1.3/index.5” failed (2: No such file or
directory)
2008/08/16 12:23:06 [debug] 8277#0: *34 http index check dir:
“/home/mike/web/192.168.1.3”
2008/08/16 12:23:06 [debug] 8277#0: *34 add cleanup: 00000000007FD978
2008/08/16 12:23:06 [debug] 8277#0: *34 open index
“/home/mike/web/192.168.1.3/index.html”
2008/08/16 12:23:06 [debug] 8277#0: *34 add cleanup: 00000000007FD9A8
So it looks like it still does your dir check like before, it just
doesn’t throw an error on access denied?
I have it set to
index index.5 index.html index.4 index.3;
and the actual file is index.html, so it has to fail the first one to
move on.
all the directories are also chmod 0711. it appears to work… it
looks like http index check dir does not cause the request to be
denied even if it doesn’t have permission… which i suppose is all i
care about. in theory that dir check i still don’t think needs to be
there until it has exhausted all the user-defined index files… but
as long as directory mode 0711 doesn’t break anything i’m happy for
now.
yeah - it did not work. PHP (the nested fastcgi location inside of the
admin location) was not processing anymore.
Yes, this is a bug. I’m looking how to resolve it.
well the regex i’m using -is- working for now. but i would like to
have my configuration fully Igor approved
right now everything is working great - the dirtest patch, the nested
location block with the regex. i can’t really test the static post
behavior (unless it’s transparent in the background) or would it be a
POST to a file that is being referenced from error_page 404 =
/wordpress/index.php?q=$request_uri; ?
If so, I need to setup a test at home using an error_page 404 handler
that actually accepts the post data (if you want someone else to
check)
For your reference this is working 100% correctly right now it appears:
server {
listen 80;
server_name foo.com;
index index.php index.html;
root /home/mike/web/foo.com/;
include /etc/nginx/defaults.conf;
include /etc/nginx/expires.conf;
error_page 404 = /wordpress/index.php?q=$request_uri;
location ~ /wordpress/admin.* {
auth_basic "wordpress";
auth_basic_user_file
yeah - it did not work. PHP (the nested fastcgi location inside of the
admin location) was not processing anymore.
Yes, this is a bug. I’m looking how to resolve it.
well the regex i’m using -is- working for now. but i would like to
have my configuration fully Igor approved
Yes, now you should use regex.
right now everything is working great - the dirtest patch, the nested
location block with the regex. i can’t really test the static post
behavior (unless it’s transparent in the background) or would it be a
POST to a file that is being referenced from error_page 404 =
/wordpress/index.php?q=$request_uri; ?
If so, I need to setup a test at home using an error_page 404 handler
that actually accepts the post data (if you want someone else to
check)
/*
* ngx_http_index_test_dir() is called after the first index
* file testing has returned an error distinct from NGX_EACCES.
* This means that directory searching is allowed.
*/
I’m not knowledgeable enough to know if that makes sense from a
syscall/coding perspective. But it sounds right. You don’t typically
put comments in the code from what I’ve seen; feel free to remove the
comment, I don’t need it for my sake
On Sat, Aug 16, 2008 at 12:28:12PM -0700, mike wrote:
…/nginx-patches/0.7.10-dirtest.txt
2008/08/16 12:23:06 [debug] 8277#0: *34 add cleanup: 00000000007FD948
So it looks like it still does your dir check like before, it just
doesn’t throw an error on access denied?
Yes. For the reason described in patch’s comment:
/*
* ngx_http_index_test_dir() is called after the first
index
* file testing has returned an error distinct from
NGX_EACCES.
* This means that directory searching is allowed.
*/
On Sat, Aug 16, 2008 at 02:33:33PM -0700, mike wrote:
I will try that again when I get home but I brought this up again
because I realized it wasn’t fully protected after all. Does it matter
what order of location blocks are defined ?
Yeah, this page is great but it is -really- confusing, I try to read
it over and over to fully understand it. Thank god there is this
mailing list and help!
I will try that again when I get home but I brought this up again
because I realized it wasn’t fully protected after all. Does it matter
what order of location blocks are defined ?
I love how small code-wise these changes are for such functional
differences. nginx is a technical marvel - so much functionality with
such little code!
I will try out this patch, but I am curious - why isn’t my existing
method using the plain old /wordpress/wp-admin.* regex an acceptable
workaround (until this “bug” as you’ve said is fixed) - or is this
patch the “fix” for that behavior, if it works?
okay, so which out of these is the most efficient method? Maybe our
language barrier is confusing me but I am not sure which method you
are recommending or are saying is fixed/not fixed/the proper way…
i’m on a 0.7.10 build now with the following 3 patches:
On Sun, Aug 17, 2008 at 12:50:54AM -0700, mike wrote:
fastcgi
auth
(static locations)
fastcgi
}
okay, so which out of these is the most efficient method? Maybe our
language barrier is confusing me but I am not sure which method you
are recommending or are saying is fixed/not fixed/the proper way…
The more effective is second method (using ^~).
The inclusive patch fixes all threee above configuration.
If you look at configuration schema
then without the patch a request /wordpress/wp-admin/some.php
*) will be handled as (1) if you replace “???” with “^~”,
*) will be handled as (3) if you replace “???” with “~”,
*) will be handled as (3) if you omit “???” at all.
The patch force to handle the request in (2) always.