default.stpl 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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%:%proxy_ssl_port% ssl;
  8. server_name %domain_idn% %alias_idn%;
  9. error_log /var/log/%web_system%/domains/%domain%.error.log error;
  10. ssl_certificate %ssl_pem%;
  11. ssl_certificate_key %ssl_key%;
  12. #Commented out ssl_stapling directives due to Lets Encrypt ending OCSP support in 2025
  13. #ssl_stapling on;
  14. #ssl_stapling_verify on;
  15. # TLS 1.3 0-RTT anti-replay
  16. if ($anti_replay = 307) { return 307 https://$host$request_uri; }
  17. if ($anti_replay = 425) { return 425; }
  18. include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
  19. location ~ /\.(?!well-known\/|file) {
  20. deny all;
  21. return 404;
  22. }
  23. location / {
  24. proxy_ssl_server_name on;
  25. proxy_ssl_name $host;
  26. proxy_pass https://%ip%:%web_ssl_port%;
  27. location ~* ^.+\.(%proxy_extensions%)$ {
  28. try_files $uri @fallback;
  29. root %sdocroot%;
  30. access_log /var/log/%web_system%/domains/%domain%.log combined;
  31. access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
  32. expires max;
  33. }
  34. }
  35. location @fallback {
  36. proxy_ssl_server_name on;
  37. proxy_ssl_name $host;
  38. proxy_pass https://%ip%:%web_ssl_port%;
  39. }
  40. location /error/ {
  41. alias %home%/%user%/web/%domain%/document_errors/;
  42. }
  43. proxy_hide_header Upgrade;
  44. include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
  45. }