default.stpl 1.5 KB

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