drupal6.tpl 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 @rewrite;
  32. location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
  33. try_files $uri @rewrite;
  34. expires max;
  35. log_not_found off;
  36. }
  37. location ~ ^/sites/.*/files/imagecache/ {
  38. try_files $uri @rewrite;
  39. }
  40. location ~ '\.php$|^/update.php' {
  41. fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
  42. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  43. fastcgi_pass %backend_lsnr%;
  44. include /etc/nginx/fastcgi_params;
  45. }
  46. }
  47. error_page 403 /error/404.html;
  48. error_page 404 /error/404.html;
  49. error_page 500 502 503 504 /error/50x.html;
  50. location /error/ {
  51. alias %home%/%user%/web/%domain%/document_errors/;
  52. }
  53. location ~* "/\.(htaccess|htpasswd)$" {
  54. deny all;
  55. return 404;
  56. }
  57. location /vstats/ {
  58. alias %home%/%user%/web/%domain%/stats/;
  59. include %home%/%user%/conf/web/%domain%.auth*;
  60. }
  61. include /etc/nginx/conf.d/phpmyadmin.inc*;
  62. include /etc/nginx/conf.d/phppgadmin.inc*;
  63. include /etc/nginx/conf.d/webmail.inc*;
  64. include %home%/%user%/conf/web/nginx.%domain%.conf*;
  65. }