On Thu, Feb 03, 2011 at 04:37:05AM -0500, xopek wrote:
> Мне подсказали в другом месте и вот
> окончательный вариант для maxsite cms :)
> [code]
> server {
> listen 80;
> server_name site.ru;
> location ~ \.php {
> fastcgi_pass unix:/tmp/php-fpm.sock;
> fastcgi_index index.php;
> include fastcgi_params;
> fastcgi_param SCRIPT_FILENAME
> /path/to/maxsite$fastcgi_script_name;
> fastcgi_param PATH_INFO $fastcgi_script_name;
> access_log off;
> }
>
> location / {
> root /path/to/maxsite;
> index index.php;
>
> if (-f $request_filename) {
> expires max;
> break;
> }
>
> if (!-e $request_filename){
> rewrite (.*) /index.php/$1;
> }
> }
>
> }
> [/code]
> Всем спасибо ;)
Это неправильная конфигурация, вот правильная:
location / {
try_files $uri $uri/ @maxsite;
}
location ~ \.php {
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME
/path/to/maxsite$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
}
location @maxsite {
fastcgi_pass unix:/tmp/php-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME
/path/to/maxsite/index.php;
fastcgi_param PATH_INFO /index.php$uri;
}
--
Igor Sysoev
http://sysoev.ru/en/
_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://nginx.org/mailman/listinfo/nginx-ru