drupal6.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. 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 @rewrite;
  34. }
  35. location @rewrite {
  36. rewrite ^/(.*)$ /index.php?q=$1;
  37. }
  38. location ~ /vendor/.*\.php$ {
  39. deny all;
  40. return 404;
  41. }
  42. location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
  43. try_files $uri @rewrite;
  44. expires max;
  45. log_not_found off;
  46. }
  47. location ~ ^/sites/.*/files/imagecache/ {
  48. try_files $uri @rewrite;
  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. error_page 403 /error/404.html;
  57. error_page 404 /error/404.html;
  58. error_page 500 502 503 504 /error/50x.html;
  59. location /error/ {
  60. alias %home%/%user%/web/%domain%/document_errors/;
  61. }
  62. location ~* "/\.(htaccess|htpasswd)$" {
  63. deny all;
  64. return 404;
  65. }
  66. location /vstats/ {
  67. alias %home%/%user%/web/%domain%/stats/;
  68. include %home%/%user%/conf/web/%domain%.auth*;
  69. }
  70. include /etc/nginx/conf.d/phpmyadmin.inc*;
  71. include /etc/nginx/conf.d/phppgadmin.inc*;
  72. include %home%/%user%/conf/web/%domain%/nginx.conf_*;
  73. }