caching.stpl 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #=======================================================================#
  2. # Default Web Domain Template #
  3. # DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
  4. #=======================================================================#
  5. server {
  6. listen %ip%:%proxy_ssl_port% ssl http2;
  7. server_name %domain_idn% %alias_idn%;
  8. ssl_certificate %ssl_pem%;
  9. ssl_certificate_key %ssl_key%;
  10. ssl_stapling on;
  11. ssl_stapling_verify on;
  12. error_log /var/log/%web_system%/domains/%domain%.error.log error;
  13. include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
  14. location / {
  15. proxy_pass https://%ip%:%web_ssl_port%;
  16. proxy_cache cache;
  17. proxy_cache_valid 15m;
  18. proxy_cache_valid 404 1m;
  19. proxy_no_cache $no_cache;
  20. proxy_cache_bypass $no_cache;
  21. proxy_cache_bypass $cookie_session $http_x_update;
  22. location ~* ^.+\.(%proxy_extentions%)$ {
  23. proxy_cache off;
  24. root %sdocroot%;
  25. access_log /var/log/%web_system%/domains/%domain%.log combined;
  26. access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
  27. expires max;
  28. try_files $uri @fallback;
  29. }
  30. }
  31. location /error/ {
  32. alias %home%/%user%/web/%domain%/document_errors/;
  33. }
  34. location @fallback {
  35. proxy_pass https://%ip%:%web_ssl_port%;
  36. }
  37. location ~ /\.ht {return 404;}
  38. location ~ /\.svn/ {return 404;}
  39. location ~ /\.git/ {return 404;}
  40. location ~ /\.hg/ {return 404;}
  41. location ~ /\.bzr/ {return 404;}
  42. include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
  43. }