drupal-composer.stpl 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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_ssl_port% ssl http2;
  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. ssl_certificate %ssl_pem%;
  14. ssl_certificate_key %ssl_key%;
  15. ssl_stapling on;
  16. ssl_stapling_verify on;
  17. include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
  18. location = /favicon.ico {
  19. log_not_found off;
  20. access_log off;
  21. }
  22. location = /robots.txt {
  23. allow all;
  24. log_not_found off;
  25. access_log off;
  26. }
  27. location ~ \..*/.*\.php$ {
  28. deny all;
  29. return 404;
  30. }
  31. location ~ ^/sites/.*/private/ {
  32. deny all;
  33. return 404;
  34. }
  35. location ~ ^/sites/[^/]+/files/.*\.php$ {
  36. deny all;
  37. return 404;
  38. }
  39. location ~ /\.(?!well-known\/) {
  40. deny all;
  41. return 404;
  42. }
  43. location / {
  44. try_files $uri $uri/ /index.php?$query_string;
  45. 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)$ {
  46. try_files $uri @rewrite;
  47. expires 30d;
  48. fastcgi_hide_header "Set-Cookie";
  49. }
  50. location ~ [^/]\.php(/|$)|^/update.php {
  51. fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
  52. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  53. try_files $uri =404;
  54. fastcgi_pass %backend_lsnr%;
  55. fastcgi_index index.php;
  56. fastcgi_param SCRIPT_FILENAME $request_filename;
  57. include /etc/nginx/fastcgi_params;
  58. include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
  59. set $no_cache 0;
  60. if ($request_uri ~* "/user/|/admin/|index.php") {
  61. set $no_cache 1;
  62. }
  63. if ($http_cookie ~ SESS) {
  64. set $no_cache 1;
  65. }
  66. }
  67. location ~ ^/sites/.*/files/styles/ {
  68. try_files $uri @rewrite;
  69. }
  70. }
  71. location @rewrite {
  72. rewrite ^/(.*)$ /index.php?q=$1;
  73. }
  74. rewrite ^/index.php/(.*) /$1 permanent;
  75. location /error/ {
  76. alias %home%/%user%/web/%domain%/document_errors/;
  77. }
  78. location /vstats/ {
  79. alias %home%/%user%/web/%domain%/stats/;
  80. include %home%/%user%/web/%domain%/stats/auth.conf*;
  81. }
  82. include /etc/nginx/conf.d/phpmyadmin.inc*;
  83. include /etc/nginx/conf.d/phppgadmin.inc*;
  84. include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
  85. }