drupal.stpl 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. ssl_stapling on;
  17. ssl_stapling_verify on;
  18. # TLS 1.3 0-RTT anti-replay
  19. if ($anti_replay = 307) { return 307 https://$host$request_uri; }
  20. if ($anti_replay = 425) { return 425; }
  21. include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
  22. location = /favicon.ico {
  23. log_not_found off;
  24. access_log off;
  25. }
  26. location = /robots.txt {
  27. allow all;
  28. log_not_found off;
  29. access_log off;
  30. }
  31. 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) {
  32. deny all;
  33. return 404;
  34. }
  35. location ~ ^/sites/.*/private/ {
  36. deny all;
  37. return 404;
  38. }
  39. location ~ /vendor/.*\.php$ {
  40. deny all;
  41. return 404;
  42. }
  43. location ~ /\.(?!well-known\/) {
  44. deny all;
  45. return 404;
  46. }
  47. location / {
  48. try_files $uri $uri/ /index.php?$query_string;
  49. 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)$ {
  50. try_files $uri @rewrite;
  51. expires 30d;
  52. fastcgi_hide_header "Set-Cookie";
  53. }
  54. location ~ \..*/.*\.php$ {
  55. deny all;
  56. return 404;
  57. }
  58. location ~ ^/sites/[^/]+/files/.*\.php$ {
  59. deny all;
  60. return 404;
  61. }
  62. location ~ [^/]\.php(/|$)|^/update.php {
  63. try_files $uri =404;
  64. include /etc/nginx/fastcgi_params;
  65. fastcgi_index index.php;
  66. fastcgi_param HTTP_EARLY_DATA $rfc_early_data if_not_empty;
  67. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  68. fastcgi_param SCRIPT_FILENAME $request_filename;
  69. fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
  70. fastcgi_pass %backend_lsnr%;
  71. include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
  72. set $no_cache 0;
  73. if ($request_uri ~* "/user/|/admin/|index.php") {
  74. set $no_cache 1;
  75. }
  76. if ($http_cookie ~ SESS) {
  77. set $no_cache 1;
  78. }
  79. }
  80. location ~ ^/sites/.*/files/styles/ {
  81. try_files $uri @rewrite;
  82. }
  83. }
  84. location @rewrite {
  85. rewrite ^/(.*)$ /index.php?q=$1;
  86. }
  87. rewrite ^/index.php/(.*) /$1 permanent;
  88. location /error/ {
  89. alias %home%/%user%/web/%domain%/document_errors/;
  90. }
  91. location /vstats/ {
  92. alias %home%/%user%/web/%domain%/stats/;
  93. include %home%/%user%/web/%domain%/stats/auth.conf*;
  94. }
  95. proxy_hide_header Upgrade;
  96. include /etc/nginx/conf.d/phpmyadmin.inc*;
  97. include /etc/nginx/conf.d/phppgadmin.inc*;
  98. include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
  99. }