drupal8.stpl 2.4 KB

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