drupal7.stpl 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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%;
  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 ~ /(changelog.txt|copyright.txt|install.mysql.txt|install.pgsql.txt|install.sqlite.txt|install.txt|license.txt|maintainers.txt|license|license.txt|readme.txt|readme.md|upgrade.txt) {
  28. deny all;
  29. return 404;
  30. }
  31. location ~ \..*/.*\.php$ {
  32. deny all;
  33. return 404;
  34. }
  35. location ~ ^/sites/.*/private/ {
  36. deny all;
  37. return 404;
  38. }
  39. location ~ ^/sites/[^/]+/files/.*\.php$ {
  40. deny all;
  41. return 404;
  42. }
  43. location ~ /vendor/.*\.php$ {
  44. deny all;
  45. return 404;
  46. }
  47. location ~ /\.(?!well-known\/) {
  48. deny all;
  49. return 404;
  50. }
  51. location / {
  52. try_files $uri $uri/ /index.php?$query_string;
  53. 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)$ {
  54. try_files $uri @rewrite;
  55. expires 30d;
  56. fastcgi_hide_header "Set-Cookie";
  57. }
  58. location ~ [^/]\.php(/|$)|^/update.php {
  59. fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
  60. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  61. try_files $uri =404;
  62. fastcgi_pass %backend_lsnr%;
  63. fastcgi_index index.php;
  64. fastcgi_param SCRIPT_FILENAME $request_filename;
  65. include /etc/nginx/fastcgi_params;
  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. }