drupal6.stpl 2.2 KB

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