ПРОЕКТЫ 


  АРХИВ 


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


  • To: <nginx-ru@xxxxxxxxx>
  • Subject: Подскажите по rewrite
  • From: "maxhl" <maxhl@xxxxxxxxxxxxxx>
  • Date: Thu, 3 Dec 2009 15:46:45 +0200
  • Thread-index: AcpkoVYR0fnqFdF0SBuu4rJfPuG42AAAn9WgA94bFCAAAGvrgAAARWRQ

Hello!
Есть набор правил:
____________________________________________________________________________
RewriteCond %{QUERY_STRING} (.*)^
RewriteCond %{REQUEST_FILENAME} !-f^
RewriteCond %{REQUEST_FILENAME} !-d^
RewriteRule ^(.*)$ index.php?permalink=$1&query_str=%1 [L,QSA]^
^
^
^
^
^
#feed^
RewriteRule ^feed/rss/$ _cache/rss_main.xml [L,QSA]^
^
#sitemap^
RewriteRule ^sitemap/$ index.php?page=sitemap [L,QSA]^
RewriteRule ^sitemap/([0-9]+)/$ index.php?page=sitemap&spage=$1 [L,QSA]^
^
#contact form^
RewriteRule ^contact/$ index.php?page=contact_form [L,QSA]
____________________________________________________________________________

Подскажите как переделать это для nginx. Пробовал так:

location ~ ^.+.php$ {

        #fastcgi_param SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        fastcgi_param  SCRIPT_FILENAME  /home/user/index.php;

        #fastcgi_param SCRIPT_NAME $fastcgi_script_name;
        fastcgi_param  SCRIPT_NAME      /index.php;

        fastcgi_param PATH_INFO $fastcgi_script_name;
        #fastcgi_param PATH_INFO /index.php;

        fastcgi_param  QUERY_STRING     permalink=$uri&$args;
        #permalink=$1&query_str=%1
        fastcgi_pass unix:/mnt/md0/php-fcgi.sock;

        fastcgi_pass_request_body off;
        client_body_in_file_only clean;
        fastcgi_param  REQUEST_BODY_FILE  $request_body_file;
        fastcgi_param   CONTENT_TYPE            $content_type;

        fastcgi_param   CONTENT_LENGTH          $content_length;
        fastcgi_param   DOCUMENT_ROOT           $document_root;
        fastcgi_param   DOCUMENT_URI            $document_uri;
        fastcgi_param   GATEWAY_INTERFACE       CGI/1.1;
        fastcgi_param   REMOTE_ADDR             $remote_addr;
        fastcgi_param   REMOTE_PORT             $remote_port;
        fastcgi_param   REQUEST_URI             $request_uri;
        fastcgi_param   REQUEST_METHOD          $request_method;
        fastcgi_param   SCRIPT_NAME             $request_uri;
        fastcgi_param   SERVER_ADDR             $server_addr;
        fastcgi_param   SERVER_NAME             $server_name;
        fastcgi_param   SERVER_PORT             $server_port;
        fastcgi_param   SERVER_PROTOCOL         $server_protocol;
        fastcgi_param   SERVER_SOFTWARE         nginx/$nginx_version;

        fastcgi_param   REDIRECT_STATUS 200;
        fastcgi_index  index.php;
}

Но вместо сайта вижу исходник пхп ...
____________________________
С уважением Max ICQ 71006063



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


 




Copyright © Lexa Software, 1996-2009.