drupal6.tpl 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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 ~* \.(txt|log)$ {
  24. allow 192.168.0.0/16;
  25. deny all;
  26. }
  27. location ~ \..*/.*\.php$ {
  28. return 403;
  29. }
  30. location ~ ^/sites/.*/private/ {
  31. return 403;
  32. }
  33. location ~ ^/sites/[^/]+/files/.*\.php$ {
  34. deny all;
  35. }
  36. location / {
  37. try_files $uri @rewrite;
  38. }
  39. location @rewrite {
  40. rewrite ^/(.*)$ /index.php?q=$1;
  41. }
  42. location ~ /vendor/.*\.php$ {
  43. deny all;
  44. return 404;
  45. }
  46. location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
  47. try_files $uri @rewrite;
  48. expires max;
  49. log_not_found off;
  50. }
  51. location ~ ^/sites/.*/files/imagecache/ {
  52. try_files $uri @rewrite;
  53. }
  54. location ~ '\.php$|^/update.php' {
  55. fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
  56. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  57. fastcgi_pass %backend_lsnr%;
  58. include /etc/nginx/fastcgi_params;
  59. include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf;
  60. }
  61. location /error/ {
  62. alias %home%/%user%/web/%domain%/document_errors/;
  63. }
  64. location ~ /\.(?!well-known\/) {
  65. deny all;
  66. return 404;
  67. }
  68. location /vstats/ {
  69. alias %home%/%user%/web/%domain%/stats/;
  70. include %home%/%user%/web/%domain%/stats/auth.conf*;
  71. }
  72. include /etc/nginx/conf.d/phpmyadmin.inc*;
  73. include /etc/nginx/conf.d/phppgadmin.inc*;
  74. include %home%/%user%/conf/web/%domain%/nginx.conf_*;
  75. }