Forum: NGINX Rewrite Rules HELP needed

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
103e3ecb1c838c6c7e52a0ee12ee6e1a?d=identicon&s=25 Glen Lumanau (Guest)
on 2009-05-05 12:11
(Received via mailing list)
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
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-05-05 13:03
(Received via mailing list)
On Tue, May 05, 2009 at 04:58:43PM +0700, Glen Lumanau 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 { }
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-05-05 13:09
(Received via mailing list)
On Tue, May 05, 2009 at 02:51:40PM +0400, Igor Sysoev 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;
A626f66134aa3bbf62b7287a9ebcde48?d=identicon&s=25 Cody (Guest)
on 2009-05-05 17:08
(Received via mailing list)
Is it possible to have Nginx log the HTTP Authentication failures like
Apache does?

-Cody
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-05-05 17:10
(Received via mailing list)
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 ?
A626f66134aa3bbf62b7287a9ebcde48?d=identicon&s=25 Cody (Guest)
on 2009-05-05 17:19
(Received via mailing list)
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
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-05-05 17:28
(Received via mailing list)
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.
A626f66134aa3bbf62b7287a9ebcde48?d=identicon&s=25 Cody (Guest)
on 2009-05-05 17:39
(Received via mailing list)
Oh excellent, I'll upgrade to 7 then. Thanks!
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-05-06 06:18
(Received via mailing list)
On Tue, May 05, 2009 at 11:04:59AM +0000, Glen Lumanau 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.
This topic is locked and can not be replied to.