drupal8.stpl 2.4 KB

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