projectsend.stpl 3.0 KB

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