Client body buffering with FastCGI

Igor Sysoev igor at sysoev.ru
Fri Feb 18 16:43:54 MSK 2011


On Fri, Feb 18, 2011 at 07:43:09AM -0500, Maxim Khitrov wrote:

> http
> {
>     include mime.types;
>     sendfile on;
> 
>     server
>     {
>         listen 80 accept_filter=httpready;
>         server_name localhost;
>         root /srv/upload/ajaxplorer;
>         client_max_body_size 256m;
> 
>         location = / {
>             rewrite ^ /index.php last;
>         }
> 
>         location ~ ^/(?:index|content)\.php$ {
>             fastcgi_pass unix:/tmp/php.sock;
>             fastcgi_param SCRIPT_FILENAME $request_filename;
>             include fastcgi_params;
>         }
> 
>         location /             { deny  all; }
>         location /client/      { allow all; }
>         location /client/html/ { deny  all; }
>         location /plugins/     { allow all; }
>         location ~* \.php$     { deny  all; }
>     }
> }

BTW, it's better to not use regex at all:

     location = / {
         fastcgi_pass unix:/tmp/php.sock;
         fastcgi_param SCRIPT_FILENAME $document_root/index.php;
         include fastcgi_params;
     }

     location = /index.php {
         fastcgi_pass unix:/tmp/php.sock;
         fastcgi_param SCRIPT_FILENAME $request_filename;
         include fastcgi_params;
     }
 
     location = /content.php {
         fastcgi_pass unix:/tmp/php.sock;
         fastcgi_param SCRIPT_FILENAME $request_filename;
         include fastcgi_params;
     }
 

-- 
Igor Sysoev
http://sysoev.ru/en/



More information about the nginx mailing list