drupal6.stpl 2.5 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_ssl_port% ssl http2;
  7. server_name %domain_idn% %alias_idn%;
  8. root %sdocroot%;
  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 ~* \.(txt|log)$ {
  28. allow 192.168.0.0/16;
  29. deny all;
  30. }
  31. location ~ \..*/.*\.php$ {
  32. return 403;
  33. }
  34. location ~ ^/sites/.*/private/ {
  35. return 403;
  36. }
  37. location ~ ^/sites/[^/]+/files/.*\.php$ {
  38. deny all;
  39. }
  40. location / {
  41. try_files $uri @rewrite;
  42. }
  43. location @rewrite {
  44. rewrite ^/(.*)$ /index.php?q=$1;
  45. }
  46. location ~ /vendor/.*\.php$ {
  47. deny all;
  48. return 404;
  49. }
  50. location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
  51. try_files $uri @rewrite;
  52. expires max;
  53. log_not_found off;
  54. }
  55. location ~ ^/sites/.*/files/imagecache/ {
  56. try_files $uri @rewrite;
  57. }
  58. location ~ '\.php$|^/update.php' {
  59. fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
  60. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  61. fastcgi_pass %backend_lsnr%;
  62. include /etc/nginx/fastcgi_params;
  63. }
  64. location /error/ {
  65. alias %home%/%user%/web/%domain%/document_errors/;
  66. }
  67. location ~* "/\.(htaccess|htpasswd)$" {
  68. deny all;
  69. return 404;
  70. }
  71. location /vstats/ {
  72. alias %home%/%user%/web/%domain%/stats/;
  73. include %home%/%user%/web/%domain%/stats/auth.conf*;
  74. }
  75. include /etc/nginx/conf.d/phpmyadmin.inc*;
  76. include /etc/nginx/conf.d/phppgadmin.inc*;
  77. include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
  78. }