drupal7.stpl 2.3 KB

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