Rewrite Rules HELP needed


#1

Can you please tell me how can I translate this rewrite so it can work
with
nginx?

DirectoryIndex index.php

RewriteEngine on

RewriteCond $1 !^(index.php|images|css|js|robots.txt|favicon.ico)

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]

Thank’s


#2

On Tue, May 05, 2009 at 04:58:43PM +0700, Glen L. wrote:

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]

root …

location / {
try_files $uri $uri/ /index.php$uri$is_args$arg;
index index.php;
}

locaiton ~ .php($|/) {

}

location /images { }
location /css { }
location /js { }
location = /robots.txt { }
location = /favicon.ico { }


#3

On Tue, May 05, 2009 at 02:51:40PM +0400, Igor S. wrote:

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]

root …

location / {
try_files $uri $uri/ /index.php$uri$is_args$arg;

  • try_files  $uri  $uri/  /index.php$uri$is_args$arg;
    
  • try_files  $uri  $uri/  /index.php$uri$is_args$args;

#4

Is it possible to have Nginx log the HTTP Authentication failures like
Apache does?

-Cody


#5

On Tue, May 05, 2009 at 09:57:08AM -0500, Cody wrote:

Is it possible to have Nginx log the HTTP Authentication failures like
Apache does?

Could you show examples ?


#6

On Tue, May 05, 2009 at 10:09:48AM -0500, Cody wrote:

[Tue May 05 01:01:03 2009] [error] [client 73.103.214.122] user mike:
authentication failure for “/”: Password Mismatch

This had been added in

Changes with nginx 0.7.38 23 Feb
2009

*) Feature: authentication failures logging.

but still was not merged in 0.6.


#7

This is what the error log in Apache will show when there is an HTTP
Auth failure:

[Mon Jan 12 22:33:30 2009] [error] [client 206.54.234.130] user mike:
authentication failure for “/”: Password Mismatch
[Wed Jan 28 22:55:53 2009] [error] [client 206.54.234.130] user mike:
authentication failure for “/”: Password Mismatch
[Tue May 05 00:59:41 2009] [error] [client 73.103.214.122] user asdf
not found: /
[Tue May 05 01:01:03 2009] [error] [client 73.103.214.122] user mike:
authentication failure for “/”: Password Mismatch


#8

On Tue, May 05, 2009 at 11:04:59AM +0000, Glen L. wrote:

Is that posibble not to use it on root dir?

Just change location / to location /test

Yes, you may use any location including given by regex.


#9

Oh excellent, I’ll upgrade to 7 then. Thanks!