drupal-composer.tpl 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. server {
  2. listen %ip%:%web_port%;
  3. server_name %domain_idn% %alias_idn%;
  4. root %docroot%/web;
  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. include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
  10. location = /favicon.ico {
  11. log_not_found off;
  12. access_log off;
  13. }
  14. location = /robots.txt {
  15. allow all;
  16. log_not_found off;
  17. access_log off;
  18. }
  19. location ~ \..*/.*\.php$ {
  20. deny all;
  21. return 404;
  22. }
  23. location ~ ^/sites/.*/private/ {
  24. deny all;
  25. return 404;
  26. }
  27. location ~ ^/sites/[^/]+/files/.*\.php$ {
  28. deny all;
  29. return 404;
  30. }
  31. location ~ /\.(?!well-known\/) {
  32. deny all;
  33. return 404;
  34. }
  35. location / {
  36. try_files $uri $uri/ /index.php?$query_string;
  37. 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)$ {
  38. try_files $uri @rewrite;
  39. expires 30d;
  40. fastcgi_hide_header "Set-Cookie";
  41. }
  42. location ~ [^/]\.php(/|$)|^/update.php {
  43. fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
  44. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  45. try_files $uri =404;
  46. fastcgi_pass %backend_lsnr%;
  47. fastcgi_index index.php;
  48. fastcgi_param SCRIPT_FILENAME $request_filename;
  49. include /etc/nginx/fastcgi_params;
  50. }
  51. location ~ ^/sites/.*/files/styles/ {
  52. try_files $uri @rewrite;
  53. }
  54. }
  55. location @rewrite {
  56. rewrite ^/(.*)$ /index.php?q=$1;
  57. }
  58. rewrite ^/index.php/(.*) /$1 permanent;
  59. location /error/ {
  60. alias %home%/%user%/web/%domain%/document_errors/;
  61. }
  62. location /vstats/ {
  63. alias %home%/%user%/web/%domain%/stats/;
  64. include %home%/%user%/web/%domain%/stats/auth.conf*;
  65. }
  66. include /etc/nginx/conf.d/phpmyadmin.inc*;
  67. include /etc/nginx/conf.d/phppgadmin.inc*;
  68. include %home%/%user%/conf/web/%domain%/nginx.conf_*;
  69. }