Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ключ для кеширования
- fastcgi_cache_path /var/www/site.ru/storage/cache levels=1:2 keys_zone=site:16m inactive=30m max_size=1024m;
- # настройки сервера
- server {
- listen 80;
- server_name _ default;
- root /var/www/site.ru/html;
- # логи
- access_log off;
- error_log /var/www/site.ru/logs/error.log;
- # настройка страниц с ошибками
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root /usr/share/nginx;
- }
- # location по умолчанию, с кешированием
- location / {
- try_files $uri @zend_framework_with_cache ;
- }
- # админка, не кешируем тут ничего
- location /admin {
- try_files $uri @zend_framework_without_cache ;
- }
- # Zend Framework БЕЗ кеширования вывода
- location @zend_framework_without_cache {
- include fastcgi_params;
- fastcgi_param SCRIPT_FILENAME $document_root/php/index.php;
- fastcgi_pass 127.0.0.1:9000;
- }
- # Zend Framework с кешированием
- location @zend_framework_with_cache {
- # настройки кеширования
- fastcgi_ignore_headers "Expires" "Cache-Control";
- fastcgi_cache site;
- fastcgi_cache_valid 60m;
- include fastcgi_params;
- fastcgi_param SCRIPT_FILENAME $document_root/php/index.php;
- fastcgi_pass 127.0.0.1:9000;
- }
- # Обычные php файлы, без кешированя
- location ~\.php$ {
- include fastcgi_params;
- fastcgi_pass 127.0.0.1:9000;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement