drupal7.tpl 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #=======================================================================#
  2. # Default Web Domain Template #
  3. # DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
  4. #=======================================================================#
  5. server {
  6. listen %ip%:%web_port%;
  7. server_name %domain_idn% %alias_idn%;
  8. root %docroot%;
  9. index index.php index.html index.htm;
  10. access_log /var/log/nginx/domains/%domain%.log combined;
  11. access_log /var/log/nginx/domains/%domain%.bytes bytes;
  12. error_log /var/log/nginx/domains/%domain%.error.log error;
  13. include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
  14. location = /favicon.ico {
  15. log_not_found off;
  16. access_log off;
  17. }
  18. location = /robots.txt {
  19. allow all;
  20. log_not_found off;
  21. access_log off;
  22. }
  23. 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) {
  24. deny all;
  25. return 404;
  26. }
  27. location ~ \..*/.*\.php$ {
  28. deny all;
  29. return 404;
  30. }
  31. location ~ ^/sites/.*/private/ {
  32. deny all;
  33. return 404;
  34. }
  35. location ~ ^/sites/[^/]+/files/.*\.php$ {
  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|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(/|$)|^/update.php {
  55. fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
  56. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  57. try_files $uri =404;
  58. fastcgi_pass %backend_lsnr%;
  59. fastcgi_index index.php;
  60. fastcgi_param SCRIPT_FILENAME $request_filename;
  61. include /etc/nginx/fastcgi_params;
  62. }
  63. location ~ ^/sites/.*/files/styles/ {
  64. try_files $uri @rewrite;
  65. }
  66. }
  67. location @rewrite {
  68. rewrite ^/(.*)$ /index.php?q=$1;
  69. }
  70. rewrite ^/index.php/(.*) /$1 permanent;
  71. location /error/ {
  72. alias %home%/%user%/web/%domain%/document_errors/;
  73. }
  74. location /vstats/ {
  75. alias %home%/%user%/web/%domain%/stats/;
  76. include %home%/%user%/web/%domain%/stats/auth.conf*;
  77. }
  78. include /etc/nginx/conf.d/phpmyadmin.inc*;
  79. include /etc/nginx/conf.d/phppgadmin.inc*;
  80. include %home%/%user%/conf/web/%domain%/nginx.conf_*;
  81. }