drupal7.stpl 2.3 KB

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