projectsend.stpl 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. # Add headers to serve security related headers
  24. add_header X-Content-Type-Options nosniff;
  25. add_header X-XSS-Protection "1; mode=block";
  26. add_header X-Robots-Tag none;
  27. add_header X-Download-Options noopen;
  28. add_header X-Permitted-Cross-Domain-Policies none;
  29. add_header Referrer-Policy no-referrer;
  30. location = /robots.txt {
  31. allow all;
  32. log_not_found off;
  33. access_log off;
  34. }
  35. location ~ /\.(?!well-known\/) {
  36. deny all;
  37. return 404;
  38. }
  39. # set max upload size
  40. client_max_body_size 512M;
  41. # Disable gzip to avoid the removal of the ETag header
  42. gzip off;
  43. # Uncomment if your server is build with the ngx_pagespeed module
  44. # This module is currently not supported.
  45. #pagespeed off;
  46. error_page 403 /core/templates/403.php;
  47. error_page 404 /core/templates/404.php;
  48. location / {
  49. try_files $uri $uri/ /index.php;
  50. }
  51. location ~ \.php$ {
  52. try_files $fastcgi_script_name =404;
  53. include /etc/nginx/fastcgi_params;
  54. fastcgi_intercept_errors on;
  55. fastcgi_param HTTP_EARLY_DATA $rfc_early_data if_not_empty;
  56. fastcgi_param front_controller_active true;
  57. # Avoid sending the security headers twice
  58. fastcgi_param modHeadersAvailable true;
  59. fastcgi_param PATH_INFO $fastcgi_path_info;
  60. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  61. fastcgi_request_buffering off;
  62. fastcgi_split_path_info ^(.+\.php)(/.*)$;
  63. fastcgi_pass unix:/run/php/php7.4-fpm.sock;
  64. }
  65. location ~* \.(?:svg|gif|png|webp|html|ttf|woff|ico|jpg|jpeg)$ {
  66. try_files $uri /index.php$uri$is_args$args;
  67. # Optional: Don't log access to other assets
  68. access_log off;
  69. }
  70. location /error/ {
  71. alias %home%/%user%/web/%domain%/document_errors/;
  72. }
  73. location /vstats/ {
  74. alias %home%/%user%/web/%domain%/stats/;
  75. include %home%/%user%/web/%domain%/stats/auth.conf*;
  76. }
  77. proxy_hide_header Upgrade;
  78. include /etc/nginx/conf.d/phpmyadmin.inc*;
  79. include /etc/nginx/conf.d/phppgadmin.inc*;
  80. include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
  81. }