При хранении в файлах:
|
---|
#### user defined variables # document root root /home/bitrix/www; # apache|php-fpm upstream set $backend "127.0.0.1:8080"; #### /user defined variables # default path to cache file set $test_file "/bitrix/html_pages/$host$uri/index@$args.html"; set $storedAuth ""; set $usecache ""; # 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"; } # IE9 and above exclude modern_browser_value "modern"; modern_browser msie 10.0; modern_browser unlisted; if ($modern_browser) { set $usecache "${usecache}E"; } # 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"; } if ( $storedAuth !~ "ABC" ) { set $usecache "${usecache}F"; } ## cache location location ~* @.*\.html$ { internal; } # use default cache file location / { if ($usecache != "ABCDEF" ) { proxy_pass http://$backend; } try_files $test_file @apache; } # use own path to cache file: test_file location ~* ^(.*)\.php$ { set $test_file "/bitrix/html_pages/$host$1@$args.html"; if ($usecache != "ABCDEF" ) { proxy_pass http://$backend; } try_files $test_file @apache; } # apache location location @apache { proxy_pass http://$backend; } |
Просмотров: 14402 (Статистика ведётся с 06.02.2017)
Дата последнего изменения: 16.04.2018
Дата последнего изменения: 16.04.2018
Сложность урока:
2 уровень - несложные понятия и действия, но не расслабляйтесь.
1
2
3
4
5