drupal6.stpl 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. server {
  2. listen %ip%:%web_ssl_port% ssl;
  3. server_name %domain_idn% %alias_idn%;
  4. root %sdocroot%;
  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. ssl_certificate %ssl_pem%;
  10. ssl_certificate_key %ssl_key%;
  11. location @rewrite {
  12. rewrite ^/(.*)$ /index.php?q=$1;
  13. }
  14. location / {
  15. location = /favicon.ico {
  16. log_not_found off;
  17. access_log off;
  18. }
  19. location = /robots.txt {
  20. allow all;
  21. log_not_found off;
  22. access_log off;
  23. }
  24. location ~ \..*/.*\.php$ {
  25. return 403;
  26. }
  27. location ~ ^/sites/.*/private/ {
  28. return 403;
  29. }
  30. location ~ ^/sites/[^/]+/files/.*\.php$ {
  31. deny all;
  32. }
  33. try_files $uri @rewrite;
  34. location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
  35. try_files $uri @rewrite;
  36. expires max;
  37. log_not_found off;
  38. }
  39. location ~ ^/sites/.*/files/imagecache/ {
  40. try_files $uri @rewrite;
  41. }
  42. location ~ '\.php$|^/update.php' {
  43. fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
  44. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  45. fastcgi_pass %backend_lsnr%;
  46. include /etc/nginx/fastcgi_params;
  47. }
  48. }
  49. error_page 403 /error/404.html;
  50. error_page 404 /error/404.html;
  51. error_page 500 502 503 504 /error/50x.html;
  52. location /error/ {
  53. alias %home%/%user%/web/%domain%/document_errors/;
  54. }
  55. location ~* "/\.(htaccess|htpasswd)$" {
  56. deny all;
  57. return 404;
  58. }
  59. location /vstats/ {
  60. alias %home%/%user%/web/%domain%/stats/;
  61. include %home%/%user%/conf/web/%domain%.auth*;
  62. }
  63. include /etc/nginx/conf.d/phpmyadmin.inc*;
  64. include /etc/nginx/conf.d/phppgadmin.inc*;
  65. include /etc/nginx/conf.d/webmail.inc*;
  66. include %home%/%user%/conf/web/snginx.%domain%.conf*;
  67. }