Re: спрятать index.php

Igor Sysoev igor на sysoev.ru
Вт Апр 12 18:58:50 MSD 2011


On Tue, Apr 12, 2011 at 09:59:08AM -0400, kirpich wrote:
> лучше покажу location корневой
> 
> 
>         location  / {
>             if ($request_filename != "index.php") {
>                 rewrite ^(.*)$ /index.php break;
>              }
> 
>             fastcgi_pass  phpfarm;
>             fastcgi_index  index.php;
>             fastcgi_param  SCRIPT_FILENAME 
> /home/vhost/site$fastcgi_script_name;
>             fastcgi_param  DOCUMENT_ROOT   /home/vhost/site;
>             include        /etc/nginx/fastcgi_params;
>             proxy_redirect off;
>             client_body_buffer_size 128k;
>             fastcgi_connect_timeout 300;
>             fastcgi_send_timeout 300;
>             fastcgi_read_timeout 300;
>             fastcgi_buffer_size     4M;
>             fastcgi_buffers         4 4M;
>             fastcgi_busy_buffers_size  8M;
>             fastcgi_temp_file_write_size 50M;
>             fastcgi_param   COBNUT_PATH     /home/vhost/Cobnut/;
>             fastcgi_param   SITE_PATH       /home/vhost/site/;
>             fastcgi_param   SITE_CONFIG_MAIN        config/conf.ini;
>             fastcgi_param   SITE_CONFIG_REWRITE     config/prod.ini;
>             fastcgi_param   SITE_NAME       site;
>             fastcgi_param   TMP     /home/vhost/site/tmp/;
>             fastcgi_temp_path /home/vhost/site/tmp/;
>             fastcgi_param   NGINX_UPLOAD_PROGRESS_URL      
> http://site_name/progress;
>             track_uploads proxied 30s;
>        }
> 
> nginx + php-fpm. 
> 
> Ваш вариант не подойдёт из за вот таких
> вот конфигов =(

location / {
    fastcgi_pass   phpfarm;
    fastcgi_param  SCRIPT_FILENAME /home/vhost/site/index.php
    fastcgi_param  PATH_INFO       $uri;
    root           /home/vhost/site;
    include        /etc/nginx/fastcgi_params;
    ...
}


-- 
Igor Sysoev



Подробная информация о списке рассылки nginx-ru