ПРОЕКТЫ 


  АРХИВ 


Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


  СТАТЬИ 


  ПЕРСОНАЛЬНОЕ 


  ПРОГРАММЫ 



ПИШИТЕ
ПИСЬМА












     АРХИВ :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

rewrite rul


  • To: nginx-ru@xxxxxxxxx
  • Subject: rewrite rul
  • From: "yokodzun" <nginx-forum@xxxxxxxx>
  • Date: Wed, 20 Jul 2011 13:59:16 -0400
  • Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mickey.jlkhosting.com; s=x; h=Date:Sender:From:Message-ID:Content-Transfer-Encoding:Content-Type:Subject:To; bh=09bC3sHyRukbPA1puw4Z37zshyGcKmAeWhGYSrVn1OE=; b=WGKZC2E0hot4DagblPPPFkNOSzVSSrWJknxqfxIJ1UogXFR2/6V7D52YQwsfo5JD0S6P0PFS7NxJEGMXcsSo49FV+iSBcauStScPkylF8wfGNurVurWkNg2y4Gna4CjL;

Пытаюсь сконвертить следующие rewrite
правила из синтаксиса mod_rewrite в
синтаксис Nginx:

RewriteBase /
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-l
  # Administration URL rewriting.
  RewriteRule ^admin(.*)$ admin/index.php?$1 [L,QSA]
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-l
  # Main URL rewriting.
  RewriteRule ^(.*)$ index.php?PAGE=$1 [L,QSA]

второе правило удалось застравить
работать, первое - никак.

конфиг такой:

server {
        listen       80;
        server_name domain.tld
        location /      {
                root  /v/http/domain.tld;
                try_files $uri $uri/ @rewrite;
                autoindex    off;
        }

                location @rewrite {
                rewrite ^/admin/(.*)$ /admin/index.php?$1;
                rewrite ^/(.*)$ /index.php?PAGE=$1;
                }


location ~ \.php$       {
                fastcgi_pass    unix:/tmp/php-fpm.sock;
                fastcgi_index  index.php;
                fastcgi_param   DOCUMENT_ROOT /v/http/domain.tld;
                fastcgi_param   SCRIPT_FILENAME
/v/http/domain.tld$fastcgi_script_name;
                include        fastcgi_params;
                        }
        }

Где я ошибся? Почему для /admin/ не
срабатывает правило?

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?21,212699,212699#msg-212699

_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://mailman.nginx.org/mailman/listinfo/nginx-ru


 




Copyright © Lexa Software, 1996-2009.