fast_cgi

Peter A. Shevtsov mera mera.com.ru
26 11:30:13 MSK 2009


26  2009 . 14:05  Andrew Kopeyko <kaa at zvuki.ru> :
> Peter A. Shevtsov wrote:
>>
>> server {
>>    if ($host ~* www\.(.*)) {
>>        set $host_without_www $1;
>>        rewrite ^(.*)$ http://$host_without_www$1 permanent;
>>    }
>>
>>    if ($host !~* www\.(.*)) {
>>        set $host_without_www $host;
>>    }
>>
>>    if ($host !~*
>>
>> ^(mera.com.ru|www.mera.com.ru|m3ra.ru|www.m3ra.ru|mhra.ru|www.mhra.ru|mhera.ru|www.mhera.ru|time-to-live.net.ru|www.time-to-live.net.ru|dotu.ru|www.dotu.ru)$
>> ) {
>>        return 444;
>>    }
>>
>>    access_log /var/log/nginx/$host_without_www.access.log main;
>>    error_log  /var/log/nginx/wpmu.error.log info;
>>
>>    root     /var/www/html/default;
>>    limit_conn  myzone 5;
>>    listen    80;
>>    server_name mera.com.ru www.mera.com.ru m3ra.ru www.m3ra.ru
>> mhra.ru www.mhra.ru mhera.ru www.mhera.ru time-to-live.net.ru
>> www.time-to-live.net.ru dotu.ru www.dotu.ru;
>>    client_max_body_size 40m;
>
>  , , !
>
>    , 
> server {
>  listen 80 default;
>  server_name fake.default.host;
>  return 444;
> }
> server {
>  listen 80;
>  server_name mera.com.ru www.mera.com.ru ; #     
>  ...;
> }
>      
>     if ($host ~* www\.(.*)) {
>         set $host_without_www $1;
>         rewrite ^(.*)$ http://$host_without_www$1 permanent;
>     }
>     if ($host !~* www\.(.*)) {
>         set $host_without_www $host;
>     }
>

  ,     www.domain.tld 
domain.tld     domain.access.log.   -
  ?

>>
>>    location / {
>>        index index.php;
>>        rewrite ^.*/files/(.*) /wp-content/blogs.php?file=$1;
>>        if (!-e $request_filename) {
>>            rewrite ^.+?(/wp-.*) $1 last;
>>            rewrite ^.+?(/.*\.php)$ $1 last;
>>            rewrite ^ /index.php last;
>>        }
>>    }
>
> 
> location /files/ {
>  internal;
>  root ...;
> }
>

 root    ?  
myblog.tld/files/file_name.ext ģ   blogs.php  
 x-accel-redirect  /blogs.dir/$myblog_id/files/file_name.ext

>>    location = /favicon.ico {
>>        return 204;
>>    }
>>
>>    location ~ \.php$ {
>>      include fastcgi_params;
>>      fastcgi_pass  unix:/var/lib/php/php-fpm.sock;
>>      fastcgi_index index.php;
>>      fastcgi_read_timeout 600;
>>      fastcgi_intercept_errors on;
>>    }
>>
>>    # deny access to .htaccess files, if Apache's document root
>>    # concurs with nginx's one
>>    #
>>    location ~ /\.ht {
>>      deny all;
>>    }
>> }
>>
>> 25  2009 . 18:54  Andrew Kopeyko <kaa at zvuki.ru>
>> :
>>>
>>> Peter A. Shevtsov wrote:
>>>>
>>>>   :
>>>> location / {
>>>>  index index.php;
>>>>  rewrite ^.*/files/(.*) /wp-content/blogs.php?file=$1;
>>>>  if (!-e $request_filename) {
>>>>    rewrite ^.+?(/wp-.*) $1 last;
>>>>    rewrite ^.+?(/.*\.php)$ $1 last;
>>>>    rewrite ^ /index.php last;
>>>>  }
>>>> }
>>>
>>> ,       -  ģ  
>>> 
>>> ͣ    fast-cgi.
>>>
>>> ,     .
>>>
>>>>  /wp-content/blogs.php    
>>>> wp-content/blogs.dir/
>>>>
>>>>      location,  
>>>> x-accel-redirect?
>>>
>>>  -  
>>> /files/19970604_Proses_mirivozzrencheskix_transformatsiy.pdf
>>>     upstream
>>> "fastcgi://unix:/var/lib/php/php-fpm.sock:",
>>>
>>>
>>>> 25  2009 . 18:24  Andrew Kopeyko <kaa at zvuki.ru>
>>>> :
>>>>>
>>>>> On Wed, 25 Nov 2009, Peter A. Shevtsov wrote:
>>>>>
>>>>>>       .    , 
>>>>>> ţ   readfile();   ,   - blogs.php 
>>>>>> Wordpress MU   .      
>>>>>>  x-accel-redirect.   "" 
>>>>>> x-accel-redirect  :
>>>>>>
>>>>>> 2009/11/25 14:58:52 [error] 3989#0: *222 rewrite or internal
>>>>>> redirection cycle while processing "/wp-content/blogs.php", client:
>>>>>> 65.55.106.232, server: mera.com.ru, request: "GET
>>>>>> /files/19970604_Proses_mirivozzrencheskix_transformatsiy.pdf
>>>>>> HTTP/1.0", upstream: "fastcgi://unix:/var/lib/php/php-fpm.sock:",
>>>>>> host: "dotu.ru"
>>>>>
>>>>> ,  
>>>>> /files/19970604_Proses_mirivozzrencheskix_transformatsiy.pdf
>>>>>    fast-cgi.
>>>>>   ,   x-accel-redirect,   
>>>>> .
>>>>>
>>>>>     location   
>>>>> x-accel-redirect
>>>>>  -    .
>>>>>
>>>>>
>>>>> 25  2009 . 15:15  Alexandr Kutuzov
>>>>> <alleteam at gmail.com> :
>>>>>>
>>>>>>       x-accel-redirect 
>>>>>> 
>>>>>> .
>>>>>>
>>>>>> 25.11.2009,  12:01,   ():
>>>>>>
>>>>>>> !
>>>>>>>
>>>>>>>  : nginx+fast_cgi+php-fpm.  PHP , 
>>>>>>>     (pdf).    
>>>>>>>  ~3,    ,    3 
>>>>>>> 
>>>>>>> ӣ.  ,      ?
>>>>>>>
>>>>>>> .
>>>>>>>
>>>
>>> --
>>> Best regards,
>>> Andrew A. Kopeyko <kaa at zvuki.ru>
>>> http://www.zvuki.ru/
>>>
>>> _______________________________________________
>>> nginx-ru mailing list
>>> nginx-ru at nginx.org
>>> http://nginx.org/mailman/listinfo/nginx-ru
>>>
>>
>>
>>
>
>
> --
> Best regards,
> Andrew A. Kopeyko <kaa at zvuki.ru>
> http://www.zvuki.ru/
>
> _______________________________________________
> nginx-ru mailing list
> nginx-ru at nginx.org
> http://nginx.org/mailman/listinfo/nginx-ru
>



-- 
 


nginx-ru