drupal7.tpl 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. location = /favicon.ico {
  10. log_not_found off;
  11. access_log off;
  12. }
  13. location = /robots.txt {
  14. allow all;
  15. log_not_found off;
  16. access_log off;
  17. }
  18. location ~* \.(txt|log)$ {
  19. allow 192.168.0.0/16;
  20. deny all;
  21. }
  22. location ~ \..*/.*\.php$ {
  23. return 403;
  24. }
  25. location ~ ^/sites/.*/private/ {
  26. return 403;
  27. }
  28. location ~ ^/sites/[^/]+/files/.*\.php$ {
  29. deny all;
  30. }
  31. location / {
  32. try_files $uri /index.php?$query_string;
  33. }
  34. location ~ /vendor/.*\.php$ {
  35. deny all;
  36. return 404;
  37. }
  38. location ~ ^/sites/.*/files/styles/ {
  39. try_files $uri @rewrite;
  40. }
  41. location ~ ^(/[a-z\-]+)?/system/files/ {
  42. try_files $uri /index.php?$query_string;
  43. }
  44. location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
  45. try_files $uri @rewrite;
  46. expires max;
  47. log_not_found off;
  48. }
  49. location ~ '\.php$|^/update.php' {
  50. fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
  51. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  52. fastcgi_pass %backend_lsnr%;
  53. include /etc/nginx/fastcgi_params;
  54. }
  55. error_page 403 /error/404.html;
  56. error_page 404 /error/404.html;
  57. error_page 500 502 503 504 /error/50x.html;
  58. location /error/ {
  59. alias %home%/%user%/web/%domain%/document_errors/;
  60. }
  61. location ~* "/\.(htaccess|htpasswd)$" {
  62. deny all;
  63. return 404;
  64. }
  65. location /vstats/ {
  66. alias %home%/%user%/web/%domain%/stats/;
  67. include %home%/%user%/conf/web/%domain%.auth*;
  68. }
  69. include /etc/nginx/conf.d/phpmyadmin.inc*;
  70. include /etc/nginx/conf.d/phppgadmin.inc*;
  71. include /etc/nginx/conf.d/webmail.inc*;
  72. include %home%/%user%/conf/web/nginx.%domain%.conf*;
  73. }