О! Всё уже есть:
Код:
server {
listen 80;
server_name echo-group.biz;
set $test_file "bitrix/html_pages/$host$uri/index@$args.html";
set $storedAuth "";
set $usecache "";
# check user auth
if ( $cookie_BITRIX_SM_LOGIN != "" ) { set $storedAuth "A"; }
if ( $cookie_BITRIX_SM_UIDH != "" ) { set $storedAuth "${storedAuth}B"; }
if ( $cookie_BITRIX_SM_CC != "Y" ) { set $storedAuth "${storedAuth}C"; }
# check all conditions for enable composite
if ( $http_bx_action_type = "" ) { set $usecache "A"; }
if ( $request_method = "GET" ) { set $usecache "${usecache}B"; }
if ( $cookie_BITRIX_SM_NCC = "" ) { set $usecache "${usecache}C"; }
if ( $http_x_forwarded_scheme !~ "https" ){ set $usecache "${usecache}D"; }
if ( $storedAuth !~ "ABC" ) { set $usecache "${usecache}E"; }
## cache location
location ~* @.*\.html$ {
internal;
root /home/bitrix/www/bitrix/cache;
}
location / {
root /home/bitrix/www;
index index.php index.html index.htm;
if (!-e $request_filename){
rewrite ^(.*)$ /bitrix/urlrewrite.php last;
}
if ( -f "$document_root/$test_file" ) { set $usecache "${usecache}F"; }
if ($usecache = "ABCDEF" ){ rewrite .* /$test_file last; }
gzip_min_length 1100;
}
if ($request_filename ~* \.(css|js|gif|png|jpg|jpeg|ico)$) {
break;
}
location ~ \.php$ {
root /home/bitrix/www;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
if (!-f $request_filename) {
rewrite ^(.*)/index.php$ $1/ redirect;
}
set $test_file "bitrix/html_pages/$host$1@$args.html";
if ( -f "$document_root/$test_file" ) { set $usecache "${usecache}F"; }
if ($usecache = "ABCDEF" ){ rewrite .* /$test_file last; }
}
}