drupal-composer.stpl 3.2 KB

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