drupal-composer.tpl 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #=======================================================================#
  2. # Default Web Domain Template #
  3. # DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
  4. #=======================================================================#
  5. server {
  6. listen %ip%:%web_port%;
  7. server_name %domain_idn% %alias_idn%;
  8. root %docroot%/web;
  9. index index.php index.html index.htm;
  10. access_log /var/log/nginx/domains/%domain%.log combined;
  11. access_log /var/log/nginx/domains/%domain%.bytes bytes;
  12. error_log /var/log/nginx/domains/%domain%.error.log error;
  13. include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
  14. location = /favicon.ico {
  15. log_not_found off;
  16. access_log off;
  17. }
  18. location = /robots.txt {
  19. allow all;
  20. log_not_found off;
  21. access_log off;
  22. }
  23. location ~ \..*/.*\.php$ {
  24. deny all;
  25. return 404;
  26. }
  27. location ~ ^/sites/.*/private/ {
  28. deny all;
  29. return 404;
  30. }
  31. location ~ ^/sites/[^/]+/files/.*\.php$ {
  32. deny all;
  33. return 404;
  34. }
  35. location ~ /\.(?!well-known\/) {
  36. deny all;
  37. return 404;
  38. }
  39. location / {
  40. try_files $uri $uri/ /index.php?$query_string;
  41. location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
  42. try_files $uri @rewrite;
  43. expires 30d;
  44. fastcgi_hide_header "Set-Cookie";
  45. }
  46. location ~ [^/]\.php(/|$)|^/update.php {
  47. fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
  48. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  49. try_files $uri =404;
  50. fastcgi_pass %backend_lsnr%;
  51. fastcgi_index index.php;
  52. fastcgi_param SCRIPT_FILENAME $request_filename;
  53. include /etc/nginx/fastcgi_params;
  54. include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
  55. if ($request_uri ~* "/user/|/admin/|index.php") {
  56. set $no_cache 1;
  57. }
  58. if ($http_cookie ~ SESS) {
  59. set $no_cache 1;
  60. }
  61. }
  62. location ~ ^/sites/.*/files/styles/ {
  63. try_files $uri @rewrite;
  64. }
  65. }
  66. location @rewrite {
  67. rewrite ^/(.*)$ /index.php?q=$1;
  68. }
  69. rewrite ^/index.php/(.*) /$1 permanent;
  70. location /error/ {
  71. alias %home%/%user%/web/%domain%/document_errors/;
  72. }
  73. location /vstats/ {
  74. alias %home%/%user%/web/%domain%/stats/;
  75. include %home%/%user%/web/%domain%/stats/auth.conf*;
  76. }
  77. include /etc/nginx/conf.d/phpmyadmin.inc*;
  78. include /etc/nginx/conf.d/phppgadmin.inc*;
  79. include %home%/%user%/conf/web/%domain%/nginx.conf_*;
  80. }