default.stpl 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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_pass https://%ip%:%web_ssl_port%;
  24. location ~* ^.+\.(%proxy_extensions%)$ {
  25. try_files $uri @fallback;
  26. root %sdocroot%;
  27. access_log /var/log/%web_system%/domains/%domain%.log combined;
  28. access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
  29. expires max;
  30. }
  31. }
  32. location @fallback {
  33. proxy_pass https://%ip%:%web_ssl_port%;
  34. }
  35. location /error/ {
  36. alias %home%/%user%/web/%domain%/document_errors/;
  37. }
  38. proxy_hide_header Upgrade;
  39. include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
  40. }