caching.tpl 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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%:%web_port%;
  7. server_name %domain_idn% %alias_idn%;
  8. root %docroot%;
  9. index index.php index.html index.htm;
  10. access_log /var/log/nginx/domains/%domain%.log combined;
  11. access_log /var/log/nginx/domains/%domain%.bytes bytes;
  12. error_log /var/log/nginx/domains/%domain%.error.log error;
  13. include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
  14. location / {
  15. location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
  16. expires max;
  17. fastcgi_hide_header "Set-Cookie";
  18. }
  19. location ~ [^/]\.php(/|$) {
  20. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  21. if (!-f $document_root$fastcgi_script_name) {
  22. return 404;
  23. }
  24. fastcgi_pass %backend_lsnr%;
  25. fastcgi_index index.php;
  26. include /etc/nginx/fastcgi_params;
  27. fastcgi_cache %domain%;
  28. fastcgi_no_cache $no_cache;
  29. fastcgi_cache_bypass $no_cache;
  30. fastcgi_cache_bypass $cookie_session $http_x_update;
  31. }
  32. }
  33. location /error/ {
  34. alias %home%/%user%/web/%domain%/document_errors/;
  35. }
  36. location ~* "/\.(htaccess|htpasswd)$" {
  37. deny all;
  38. return 404;
  39. }
  40. location /vstats/ {
  41. alias %home%/%user%/web/%domain%/stats/;
  42. include %home%/%user%/web/%domain%/stats/auth.conf*;
  43. }
  44. include /etc/nginx/conf.d/phpmyadmin.inc*;
  45. include /etc/nginx/conf.d/phppgadmin.inc*;
  46. include %home%/%user%/conf/web/%domain%/nginx.conf_*;
  47. }