Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


   


   


   















      :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: : " nginx"



. cookie. . .

, .

server {
listen 80;
server_name domain.ru;
charset utf-8;
set $backend 0;
root /www/;
index default.php;

location ~* \.(rtf|doc|gz|pdf|txt|jpg|js|css|gif|jpeg|png|ico|bmp|swf)$ {
root /www/;
}

if ($uri ~ \.(pdf|txt|jpg|js|css|gif|jpeg|png|ico|bmp|swf)$) {
set $backend 0;
}

if (!-e $request_filename) {
rewrite ^(.+)$ /default.php last;
}

# - / -
location ~ \/ {
default_type text/html;
gzip_types application/octet-stream;
index default.php index.php index.html index.htm;

#
if (!-e $request_filename ) {
rewrite ^(.*)$ /default.php last;
}

if ($http_cookie !~ "th_auth" ) {
set $backend 1;
}

if ($http_cookie ~ "PHPSESSID") {
set $backend 0;
}

if ($request_method = POST) {
set $backend 0;
}

if ($request_method != GET) {
set $backend 0;
}

if ($backend = 1) {
add_header Content-Type "text/html; charset=utf-8";
set $memcached_key "$request_uri";
memcached_pass 127.0.0.1:11211;
error_page 404 405 502 504 = @fallback;
break;
}

return 404;
error_page 404 405 502 504 = @fallback;
break;

}

location @fallback {
root /www;
fastcgi_pass unix:/tmp/php-fpm.socket;
fastcgi_index default.php;
fastcgi_param SCRIPT_FILENAME /www$fastcgi_script_name;
include fastcgi_params;
#break;
}

location ~ /\.ht {
deny all;
}

location = /50x.html {
root /usr/local/www/nginx-dist;
}
}



2 2009 . 10:09 Vladislav <tvword@xxxxxxxxx> :
>
> Sky Cat :
>>
>> , , . . .
>
> ( ;)
> X-Accel-Depend
> X-Accel-New
>
>



 




Copyright © Lexa Software, 1996-2009.