drupal-composer.tpl 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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%/web;
  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 ~ ^/sites/.*/private/ {
  25. deny all;
  26. return 404;
  27. }
  28. location ~ /\.(?!well-known\/) {
  29. deny all;
  30. return 404;
  31. }
  32. location / {
  33. try_files $uri $uri/ /index.php?$query_string;
  34. 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)$ {
  35. try_files $uri @rewrite;
  36. expires 30d;
  37. fastcgi_hide_header "Set-Cookie";
  38. }
  39. location ~ \..*/.*\.php$ {
  40. deny all;
  41. return 404;
  42. }
  43. location ~ ^/sites/[^/]+/files/.*\.php$ {
  44. deny all;
  45. return 404;
  46. }
  47. location ~ [^/]\.php(/|$)|^/update.php {
  48. try_files $uri =404;
  49. include /etc/nginx/fastcgi_params;
  50. fastcgi_index index.php;
  51. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  52. fastcgi_param SCRIPT_FILENAME $request_filename;
  53. fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
  54. fastcgi_pass %backend_lsnr%;
  55. include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
  56. set $no_cache 0;
  57. if ($request_uri ~* "/user/|/admin/|index.php") {
  58. set $no_cache 1;
  59. }
  60. if ($http_cookie ~ SESS) {
  61. set $no_cache 1;
  62. }
  63. }
  64. location ~ ^/sites/.*/files/styles/ {
  65. try_files $uri @rewrite;
  66. }
  67. }
  68. location @rewrite {
  69. rewrite ^/(.*)$ /index.php?q=$1;
  70. }
  71. rewrite ^/index.php/(.*) /$1 permanent;
  72. location /error/ {
  73. alias %home%/%user%/web/%domain%/document_errors/;
  74. }
  75. location /vstats/ {
  76. alias %home%/%user%/web/%domain%/stats/;
  77. include %home%/%user%/web/%domain%/stats/auth.conf*;
  78. }
  79. include /etc/nginx/conf.d/phpmyadmin.inc*;
  80. include /etc/nginx/conf.d/phppgadmin.inc*;
  81. include %home%/%user%/conf/web/%domain%/nginx.conf_*;
  82. }