drupal7.tpl 2.2 KB

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