caching.stpl 1.3 KB

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