RewriteCond в Nginx

Igor Sysoev is at rambler-co.ru
Wed Aug 13 11:46:33 MSD 2008


On Wed, Aug 13, 2008 at 10:39:09AM +0300, Serg Senko wrote:

> Не принимает 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

- location ~  \..{2,4}$  {
+ location ~ "\..{2,4}$" {

> 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

-- 
Игорь Сысоев
http://sysoev.ru





More information about the nginx-ru mailing list