default.stpl 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. listen %ip%:%web_ssl_port% ssl;
  8. server_name %domain_idn% %alias_idn%;
  9. root %sdocroot%;
  10. index index.php index.html index.htm;
  11. access_log /var/log/nginx/domains/%domain%.log combined;
  12. access_log /var/log/nginx/domains/%domain%.bytes bytes;
  13. error_log /var/log/nginx/domains/%domain%.error.log error;
  14. ssl_certificate %ssl_pem%;
  15. ssl_certificate_key %ssl_key%;
  16. #Commented out ssl_stapling directives due to Lets Encrypt ending OCSP support in 2025
  17. #ssl_stapling on;
  18. #ssl_stapling_verify on;
  19. # TLS 1.3 0-RTT anti-replay
  20. if ($anti_replay = 307) { return 307 https://$host$request_uri; }
  21. if ($anti_replay = 425) { return 425; }
  22. include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
  23. location ~ /\.(?!well-known\/) {
  24. deny all;
  25. return 404;
  26. }
  27. location / {
  28. location ~* ^.+\.(jpeg|jpg|png|webp|gif|bmp|ico|svg|css|js)$ {
  29. expires max;
  30. fastcgi_hide_header "Set-Cookie";
  31. }
  32. location ~ [^/]\.php(/|$) {
  33. try_files $uri =404;
  34. include /etc/nginx/fastcgi_params;
  35. fastcgi_index index.php;
  36. fastcgi_param HTTP_EARLY_DATA $rfc_early_data if_not_empty;
  37. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  38. fastcgi_pass %backend_lsnr%;
  39. include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
  40. }
  41. }
  42. location /error/ {
  43. alias %home%/%user%/web/%domain%/document_errors/;
  44. }
  45. location /vstats/ {
  46. alias %home%/%user%/web/%domain%/stats/;
  47. include %home%/%user%/web/%domain%/stats/auth.conf*;
  48. }
  49. proxy_hide_header Upgrade;
  50. include /etc/nginx/conf.d/phpmyadmin.inc*;
  51. include /etc/nginx/conf.d/phppgadmin.inc*;
  52. include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
  53. }