fast_cgi

Peter A. Shevtsov mera mera.com.ru
27 12:58:18 MSK 2009


   server_name  ~^www\.(?<name>.+)$;
[emerg]: pcre_compile() failed: unrecognized character after (?< in
"^www\.(?<name>.+)$" at "name>.+)$" in
/etc/nginx/conf.d/virtual.conf:7
configuration file /etc/nginx/nginx.conf test failed


26  2009 . 23:22  Igor Sysoev <igor at sysoev.ru> :
> On Thu, Nov 26, 2009 at 12:54:43PM +0600, 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;
>
> ģ     
>
> error_log  /var/log/nginx/wpmu.error.log info;
>
> server {
>   listen 80;
>   server_name _;
>   return  444;
> }
>
> server {
>   listen 80;
>   server_name ~^www\.(?<name>.+)$;
>   rewrite  ^ http://$name$request_uri? permanent;
>
>   # 
>   access_log  /var/log/nginx/$name.access.log main;
>   #     
>   root     /var/www/html/default;
> }
>
> server {
>   listent 80;
>   server_name mera.com.ru ...;
>
>   location / {
>   ...
> }
>
>  ,     -  :  
> www...  /var/log/nginx/...access.log.
>     -   root'
> /var/www/html/default/...      
>  .
>
>>     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;
>>         }
>>     }
>
>   : /files/--  
> /wp-content/blogs.php?file=--,    
> /var/www/html/default/wp-content/blogs.php,   /files/--.
>
> location /files/ {
>   try_files $uri  /wp-content/blogs.php?file=$uri;
> }
>
>    - 
>   "X-Accel-Redirect: /protected/--"
>
> location /protected/ {
>   internal;
>   alias /var/www/html/default/files/;
> }
>
>>     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
>> >
>>
>>
>>
>> --
>>  
>> _______________________________________________
>> nginx-ru mailing list
>> nginx-ru at nginx.org
>> http://nginx.org/mailman/listinfo/nginx-ru
>
> --
>  
> http://sysoev.ru
>
> _______________________________________________
> nginx-ru mailing list
> nginx-ru at nginx.org
> http://nginx.org/mailman/listinfo/nginx-ru
>



-- 
 


nginx-ru