drupal7.stpl 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. server {
  2. listen %ip%:%web_ssl_port% ssl http2;
  3. server_name %domain_idn% %alias_idn%;
  4. root %sdocroot%;
  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. ssl_certificate %ssl_pem%;
  10. ssl_certificate_key %ssl_key%;
  11. location = /favicon.ico {
  12. log_not_found off;
  13. access_log off;
  14. }
  15. location = /robots.txt {
  16. allow all;
  17. log_not_found off;
  18. access_log off;
  19. }
  20. location ~* \.(txt|log)$ {
  21. allow 192.168.0.0/16;
  22. deny all;
  23. }
  24. location ~ \..*/.*\.php$ {
  25. return 403;
  26. }
  27. location ~ ^/sites/.*/private/ {
  28. return 403;
  29. }
  30. location ~ ^/sites/[^/]+/files/.*\.php$ {
  31. deny all;
  32. }
  33. location / {
  34. try_files $uri /index.php?$query_string;
  35. }
  36. location ~ /vendor/.*\.php$ {
  37. deny all;
  38. return 404;
  39. }
  40. location ~ ^/sites/.*/files/styles/ {
  41. try_files $uri @rewrite;
  42. }
  43. location ~ ^(/[a-z\-]+)?/system/files/ {
  44. try_files $uri /index.php?$query_string;
  45. }
  46. location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
  47. try_files $uri @rewrite;
  48. expires max;
  49. log_not_found off;
  50. }
  51. location ~ '\.php$|^/update.php' {
  52. fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
  53. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  54. fastcgi_pass %backend_lsnr%;
  55. include /etc/nginx/fastcgi_params;
  56. }
  57. error_page 403 /error/404.html;
  58. error_page 404 /error/404.html;
  59. error_page 500 502 503 504 /error/50x.html;
  60. location /error/ {
  61. alias %home%/%user%/web/%domain%/document_errors/;
  62. }
  63. location ~* "/\.(htaccess|htpasswd)$" {
  64. deny all;
  65. return 404;
  66. }
  67. location /vstats/ {
  68. alias %home%/%user%/web/%domain%/stats/;
  69. include %home%/%user%/conf/web/%domain%.auth*;
  70. }
  71. include /etc/nginx/conf.d/phpmyadmin.inc*;
  72. include /etc/nginx/conf.d/phppgadmin.inc*;
  73. include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
  74. }