Re: RewriteCond в Nginx

Serg Senko kerncore at gmail.com
Wed Aug 13 11:39:09 MSD 2008


Не принимает nginx ~ \..{2,4}$

-- сut --

location ~ \..{2,4}$

-- cut --

location такого вида

location ~ \..{2,4}$ {

            if ($request_method = POST) {
            proxy_pass http://111.111.111.111;
                }
            set   $memcached_key   "$uri?$args";
            memcached_pass  memcached_backend;
            error_page      404 502 504 = @fallback;
                limit_except GET POST {
                deny all;
                }

}

/usr/local/nginx6/sbin/nginx -t
unknown directive "2,4}$" in /usr/local/nginx6/conf/nginx.conf:122

nginx version: nginx/0.6.32




On 8/12/08, Igor Sysoev <is at rambler-co.ru> wrote:
>
> On Tue, Aug 12, 2008 at 04:28:50PM +0300, Serg Senko wrote:
>
> > Пытаюсь сделать такой rewrite в NGINX и уйти на половине серверов с
> Apache.
> > Кто то может с этим помочь ?
> >
> > RewriteCond %{REQUEST_URI} !^.*\..{2,4}$ [NC]
> > RewriteRule ^(.*) index.php [L,NC]
>
>     location / {
>         rewrite  ^ /index.php;
>     }
>
>     location = /index.php {
>         ...
>     }
>
>     location ~ \..{2,4}$ {
>         ...
>     }
>
>
> --
> Игорь Сысоев
> http://sysoev.ru
>
>


-- 
ttyv0 "/usr/libexec/gmail Pc"  webcons on secure
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx-ru/attachments/20080813/d23a7254/attachment.html>


More information about the nginx-ru mailing list