drupal6.stpl 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf;
  64. }
  65. location /error/ {
  66. alias %home%/%user%/web/%domain%/document_errors/;
  67. }
  68. location ~ /\.(?!well-known\/) {
  69. deny all;
  70. return 404;
  71. }
  72. location /vstats/ {
  73. alias %home%/%user%/web/%domain%/stats/;
  74. include %home%/%user%/web/%domain%/stats/auth.conf*;
  75. }
  76. include /etc/nginx/conf.d/phpmyadmin.inc*;
  77. include /etc/nginx/conf.d/phppgadmin.inc*;
  78. include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
  79. }