caching.tpl 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. server {
  2. listen %ip%:%proxy_port%;
  3. server_name %domain_idn% %alias_idn%;
  4. error_log /var/log/%web_system%/domains/%domain%.error.log error;
  5. location / {
  6. proxy_pass http://%ip%:%web_port%;
  7. proxy_cache cache;
  8. proxy_cache_valid 15m;
  9. proxy_cache_valid 404 1m;
  10. proxy_no_cache $no_cache;
  11. proxy_cache_bypass $no_cache;
  12. proxy_cache_bypass $cookie_session $http_x_update;
  13. location ~* ^.+\.(%proxy_extentions%)$ {
  14. proxy_cache off;
  15. root %docroot%;
  16. access_log /var/log/%web_system%/domains/%domain%.log combined;
  17. access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
  18. expires max;
  19. try_files $uri @fallback;
  20. }
  21. }
  22. location /error/ {
  23. alias %home%/%user%/web/%domain%/document_errors/;
  24. }
  25. location @fallback {
  26. proxy_pass http://%ip%:%web_port%;
  27. }
  28. location ~ /\.ht {return 404;}
  29. location ~ /\.svn/ {return 404;}
  30. location ~ /\.git/ {return 404;}
  31. location ~ /\.hg/ {return 404;}
  32. location ~ /\.bzr/ {return 404;}
  33. include %home%/%user%/web/conf/nginx.%domain%.conf*;
  34. }