Advertisement
Guest User

Untitled

a guest
Nov 10th, 2011
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. # ключ для кеширования
  2. fastcgi_cache_path /var/www/site.ru/storage/cache levels=1:2 keys_zone=site:16m inactive=30m max_size=1024m;
  3.  
  4. # настройки сервера
  5. server {
  6.  
  7. listen 80;
  8. server_name _ default;
  9. root /var/www/site.ru/html;
  10.  
  11. # логи
  12. access_log off;
  13. error_log /var/www/site.ru/logs/error.log;
  14.  
  15. # настройка страниц с ошибками
  16. error_page 500 502 503 504 /50x.html;
  17. location = /50x.html {
  18. root /usr/share/nginx;
  19. }
  20.  
  21. # location по умолчанию, с кешированием
  22. location / {
  23. try_files $uri @zend_framework_with_cache ;
  24. }
  25.  
  26. # админка, не кешируем тут ничего
  27. location /admin {
  28. try_files $uri @zend_framework_without_cache ;
  29. }
  30.  
  31. # Zend Framework БЕЗ кеширования вывода
  32. location @zend_framework_without_cache {
  33. include fastcgi_params;
  34. fastcgi_param SCRIPT_FILENAME $document_root/php/index.php;
  35. fastcgi_pass 127.0.0.1:9000;
  36. }
  37.  
  38. # Zend Framework с кешированием
  39. location @zend_framework_with_cache {
  40. # настройки кеширования
  41. fastcgi_ignore_headers "Expires" "Cache-Control";
  42. fastcgi_cache site;
  43. fastcgi_cache_valid 60m;
  44.  
  45. include fastcgi_params;
  46. fastcgi_param SCRIPT_FILENAME $document_root/php/index.php;
  47. fastcgi_pass 127.0.0.1:9000;
  48. }
  49.  
  50. # Обычные php файлы, без кешированя
  51. location ~\.php$ {
  52. include fastcgi_params;
  53. fastcgi_pass 127.0.0.1:9000;
  54. }
  55. }
  56.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement