drupal.stpl 3.4 KB

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