drupal8.tpl 2.4 KB

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