caching.stpl 1.3 KB

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