drupal.stpl 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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. location = /favicon.ico {
  24. log_not_found off;
  25. access_log off;
  26. }
  27. location = /robots.txt {
  28. allow all;
  29. log_not_found off;
  30. access_log off;
  31. }
  32. location ~ /(changelog.txt|copyright.txt|install.mysql.txt|install.pgsql.txt|install.sqlite.txt|install.txt|license.txt|maintainers.txt|license|license.txt|readme.txt|readme.md|upgrade.txt) {
  33. deny all;
  34. return 404;
  35. }
  36. location ~ ^/sites/.*/private/ {
  37. deny all;
  38. return 404;
  39. }
  40. location ~ /vendor/.*\.php$ {
  41. deny all;
  42. return 404;
  43. }
  44. location ~ /\.(?!well-known\/) {
  45. deny all;
  46. return 404;
  47. }
  48. location / {
  49. try_files $uri $uri/ /index.php?$query_string;
  50. location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|webp|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
  51. try_files $uri @rewrite;
  52. expires 30d;
  53. fastcgi_hide_header "Set-Cookie";
  54. }
  55. location ~ \..*/.*\.php$ {
  56. deny all;
  57. return 404;
  58. }
  59. location ~ ^/sites/[^/]+/files/.*\.php$ {
  60. deny all;
  61. return 404;
  62. }
  63. location ~ [^/]\.php(/|$)|^/update.php {
  64. try_files $uri =404;
  65. include /etc/nginx/fastcgi_params;
  66. fastcgi_index index.php;
  67. fastcgi_param HTTP_EARLY_DATA $rfc_early_data if_not_empty;
  68. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  69. fastcgi_param SCRIPT_FILENAME $request_filename;
  70. fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
  71. fastcgi_pass %backend_lsnr%;
  72. include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
  73. set $no_cache 0;
  74. if ($request_uri ~* "/user/|/admin/|index.php") {
  75. set $no_cache 1;
  76. }
  77. if ($http_cookie ~ SESS) {
  78. set $no_cache 1;
  79. }
  80. }
  81. location ~ ^/sites/.*/files/styles/ {
  82. try_files $uri @rewrite;
  83. }
  84. }
  85. location @rewrite {
  86. rewrite ^/(.*)$ /index.php?q=$1;
  87. }
  88. rewrite ^/index.php/(.*) /$1 permanent;
  89. location /error/ {
  90. alias %home%/%user%/web/%domain%/document_errors/;
  91. }
  92. location /vstats/ {
  93. alias %home%/%user%/web/%domain%/stats/;
  94. include %home%/%user%/web/%domain%/stats/auth.conf*;
  95. }
  96. proxy_hide_header Upgrade;
  97. include /etc/nginx/conf.d/phpmyadmin.inc*;
  98. include /etc/nginx/conf.d/phppgadmin.inc*;
  99. include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
  100. }