drupal7.tpl 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. server {
  2. listen %ip%:%web_port%;
  3. server_name %domain_idn% %alias_idn%;
  4. root %docroot%;
  5. index index.php index.html index.htm;
  6. access_log /var/log/nginx/domains/%domain%.log combined;
  7. access_log /var/log/nginx/domains/%domain%.bytes bytes;
  8. error_log /var/log/nginx/domains/%domain%.error.log error;
  9. include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
  10. location = /favicon.ico {
  11. log_not_found off;
  12. access_log off;
  13. }
  14. location = /robots.txt {
  15. allow all;
  16. log_not_found off;
  17. access_log off;
  18. }
  19. location ~* \.(txt|log)$ {
  20. allow 192.168.0.0/16;
  21. deny all;
  22. }
  23. location ~ \..*/.*\.php$ {
  24. return 403;
  25. }
  26. location ~ ^/sites/.*/private/ {
  27. return 403;
  28. }
  29. location ~ ^/sites/[^/]+/files/.*\.php$ {
  30. deny all;
  31. }
  32. location / {
  33. try_files $uri /index.php?$query_string;
  34. }
  35. location ~ /vendor/.*\.php$ {
  36. deny all;
  37. return 404;
  38. }
  39. location ~ ^/sites/.*/files/styles/ {
  40. try_files $uri @rewrite;
  41. }
  42. location ~ ^(/[a-z\-]+)?/system/files/ {
  43. try_files $uri /index.php?$query_string;
  44. }
  45. location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
  46. try_files $uri @rewrite;
  47. expires max;
  48. log_not_found off;
  49. }
  50. location ~ '\.php$|^/update.php' {
  51. fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
  52. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  53. fastcgi_pass %backend_lsnr%;
  54. include /etc/nginx/fastcgi_params;
  55. }
  56. location /error/ {
  57. alias %home%/%user%/web/%domain%/document_errors/;
  58. }
  59. location ~* "/\.(htaccess|htpasswd)$" {
  60. deny all;
  61. return 404;
  62. }
  63. location /vstats/ {
  64. alias %home%/%user%/web/%domain%/stats/;
  65. include %home%/%user%/web/%domain%/stats/auth.conf*;
  66. }
  67. include /etc/nginx/conf.d/phpmyadmin.inc*;
  68. include /etc/nginx/conf.d/phppgadmin.inc*;
  69. include %home%/%user%/conf/web/%domain%/nginx.conf_*;
  70. }