caching.tpl 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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_port%;
  7. server_name %domain_idn% %alias_idn%;
  8. include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
  9. location / {
  10. proxy_pass http://%ip%:%web_port%;
  11. proxy_cache %domain%;
  12. proxy_cache_valid 15m;
  13. proxy_cache_valid 404 1m;
  14. proxy_no_cache $no_cache;
  15. proxy_cache_bypass $no_cache;
  16. proxy_cache_bypass $cookie_session $http_x_update;
  17. location ~* ^.+\.(%proxy_extentions%)$ {
  18. proxy_cache off;
  19. root %docroot%;
  20. access_log /var/log/%web_system%/domains/%domain%.log combined;
  21. access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
  22. expires max;
  23. try_files $uri @fallback;
  24. }
  25. }
  26. location /error/ {
  27. alias %home%/%user%/web/%domain%/document_errors/;
  28. }
  29. location @fallback {
  30. proxy_pass http://%ip%:%web_port%;
  31. }
  32. location ~ /\.ht {return 404;}
  33. location ~ /\.svn/ {return 404;}
  34. location ~ /\.git/ {return 404;}
  35. location ~ /\.hg/ {return 404;}
  36. location ~ /\.bzr/ {return 404;}
  37. include %home%/%user%/conf/web/%domain%/nginx.conf_*;
  38. }