caching.stpl 1.4 KB

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