Проблема с rewrite

Igor Sysoev is at rambler-co.ru
Thu Nov 1 10:55:08 MSK 2007


On Wed, Oct 31, 2007 at 11:42:37PM +0300, Dmitry wrote:

> Решили перевести один проект с nginx + apache на nginx + factcgi php.
> 
> Но существует проблема c rewrite:
> 
> у апача была такая конфигурация:
> 
> RewriteEngine On
> RewriteBase /
> RewriteRule !\.(gif|jpg|png|css|zip|js|ico|txt|gz|sql|doc|xls|rar|pps)$ index.php
> если переделать под nginx:
> 
> rewrite !^.+\.(gif|jpg|png|css|zip|js|ico|txt|gz|sql|doc|xls|rar|pps)$ /index.php break;
> rewrite  ^/(.*)$ /index.php break;
> 
> то графика не показывается.
> 
> Что я не так делаю?

      location  /   {
          fastcgi_pass   ...
          fastcgi_param  SCRIPT_FILENAME  /home/www/scripts/php/index.php;
          ...
      }

      location ~ \.(gif|jpg|png|css|zip|js|ico|txt|gz|sql|doc|xls|rar|pps)$ {
          root  ...;
          ...
      }


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





More information about the nginx-ru mailing list