default.tpl 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #=========================================================================#
  2. # Default Web Domain Template #
  3. # DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
  4. # https://hestiacp.com/docs/server-administration/web-templates.html #
  5. #=========================================================================#
  6. server {
  7. %<i4 listen %web_ipv4%:%web_port%;i4>%
  8. %<i6 listen %web_ipv6%:%web_port%;i6>%
  9. server_name %domain_idn% %alias_idn%;
  10. root %docroot%;
  11. index index.php index.html index.htm;
  12. access_log /var/log/nginx/domains/%domain%.log combined;
  13. access_log /var/log/nginx/domains/%domain%.bytes bytes;
  14. error_log /var/log/nginx/domains/%domain%.error.log error;
  15. include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
  16. location / {
  17. location ~* ^.+\.(jpeg|jpg|png|webp|gif|bmp|ico|svg|css|js)$ {
  18. expires max;
  19. fastcgi_hide_header "Set-Cookie";
  20. }
  21. location ~ [^/]\.php(/|$) {
  22. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  23. if (!-f $document_root$fastcgi_script_name) {
  24. return 404;
  25. }
  26. fastcgi_pass %backend_lsnr%;
  27. fastcgi_index index.php;
  28. include /etc/nginx/fastcgi_params;
  29. include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
  30. }
  31. }
  32. location /error/ {
  33. alias %home%/%user%/web/%domain%/document_errors/;
  34. }
  35. location ~ /\.(?!well-known\/) {
  36. deny all;
  37. return 404;
  38. }
  39. location /vstats/ {
  40. alias %home%/%user%/web/%domain%/stats/;
  41. include %home%/%user%/web/%domain%/stats/auth.conf*;
  42. }
  43. include /etc/nginx/conf.d/phpmyadmin.inc*;
  44. include /etc/nginx/conf.d/phppgadmin.inc*;
  45. include %home%/%user%/conf/web/%domain%/nginx.conf_*;
  46. }