drupal6.stpl 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. server {
  2. listen %ip%:%web_ssl_port%;
  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 on;
  10. ssl_certificate %ssl_pem%;
  11. ssl_certificate_key %ssl_key%;
  12. location @rewrite {
  13. rewrite ^/(.*)$ /index.php?q=$1;
  14. }
  15. location / {
  16. location = /favicon.ico {
  17. log_not_found off;
  18. access_log off;
  19. }
  20. location = /robots.txt {
  21. allow all;
  22. log_not_found off;
  23. access_log off;
  24. }
  25. location ~ \..*/.*\.php$ {
  26. return 403;
  27. }
  28. location ~ ^/sites/.*/private/ {
  29. return 403;
  30. }
  31. location ~ ^/sites/[^/]+/files/.*\.php$ {
  32. deny all;
  33. }
  34. try_files $uri @rewrite;
  35. location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
  36. try_files $uri @rewrite;
  37. expires max;
  38. log_not_found off;
  39. }
  40. location ~ ^/sites/.*/files/imagecache/ {
  41. try_files $uri @rewrite;
  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/snginx.%domain%.conf*;
  68. }