drupal.tpl 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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_port%;
  8. server_name %domain_idn% %alias_idn%;
  9. root %docroot%;
  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. include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
  15. location = /favicon.ico {
  16. log_not_found off;
  17. access_log off;
  18. }
  19. location = /robots.txt {
  20. allow all;
  21. log_not_found off;
  22. access_log off;
  23. }
  24. 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) {
  25. deny all;
  26. return 404;
  27. }
  28. location ~ ^/sites/.*/private/ {
  29. deny all;
  30. return 404;
  31. }
  32. location ~ /vendor/.*\.php$ {
  33. deny all;
  34. return 404;
  35. }
  36. location ~ /\.(?!well-known\/) {
  37. deny all;
  38. return 404;
  39. }
  40. location / {
  41. try_files $uri $uri/ /index.php?$query_string;
  42. 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)$ {
  43. try_files $uri @rewrite;
  44. expires 30d;
  45. fastcgi_hide_header "Set-Cookie";
  46. }
  47. location ~ \..*/.*\.php$ {
  48. deny all;
  49. return 404;
  50. }
  51. location ~ ^/sites/[^/]+/files/.*\.php$ {
  52. deny all;
  53. return 404;
  54. }
  55. location ~ [^/]\.php(/|$)|^/update.php {
  56. try_files $uri =404;
  57. include /etc/nginx/fastcgi_params;
  58. fastcgi_index index.php;
  59. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  60. fastcgi_param SCRIPT_FILENAME $request_filename;
  61. fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
  62. fastcgi_pass %backend_lsnr%;
  63. include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
  64. set $no_cache 0;
  65. if ($request_uri ~* "/user/|/admin/|index.php") {
  66. set $no_cache 1;
  67. }
  68. if ($http_cookie ~ SESS) {
  69. set $no_cache 1;
  70. }
  71. }
  72. location ~ ^/sites/.*/files/styles/ {
  73. try_files $uri @rewrite;
  74. }
  75. }
  76. location @rewrite {
  77. rewrite ^/(.*)$ /index.php?q=$1;
  78. }
  79. rewrite ^/index.php/(.*) /$1 permanent;
  80. location /error/ {
  81. alias %home%/%user%/web/%domain%/document_errors/;
  82. }
  83. location /vstats/ {
  84. alias %home%/%user%/web/%domain%/stats/;
  85. include %home%/%user%/web/%domain%/stats/auth.conf*;
  86. }
  87. include /etc/nginx/conf.d/phpmyadmin.inc*;
  88. include /etc/nginx/conf.d/phppgadmin.inc*;
  89. include %home%/%user%/conf/web/%domain%/nginx.conf_*;
  90. }