piwik.stpl 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 = /favicon.ico {
  12. try_files /favicon.ico =204;
  13. }
  14. location / {
  15. try_files $uri /index.php;
  16. location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
  17. valid_referers none blocked %domain_idn% %alias_idn%;
  18. if ($invalid_referer) {
  19. return 444;
  20. }
  21. expires max;
  22. }
  23. location ~* ^/(?:index|piwik)\.php$ {
  24. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  25. if (!-f $document_root$fastcgi_script_name) {
  26. return 404;
  27. }
  28. fastcgi_pass %backend_lsnr%;
  29. include /etc/nginx/fastcgi_params;
  30. }
  31. }
  32. # Any other attempt to access PHP files returns a 404.
  33. location ~* ^.+\.php$ {
  34. return 404;
  35. }
  36. # Return a 404 for all text files.
  37. location ~* ^/(?:README|LICENSE[^.]*|LEGALNOTICE)(?:\.txt)*$ {
  38. return 404;
  39. }
  40. error_page 403 /error/404.html;
  41. error_page 404 /error/404.html;
  42. error_page 500 502 503 504 /error/50x.html;
  43. location /error/ {
  44. alias %home%/%user%/web/%domain%/document_errors/;
  45. }
  46. location ~* "/\.(htaccess|htpasswd)$" {
  47. deny all;
  48. return 404;
  49. }
  50. location /vstats/ {
  51. alias %home%/%user%/web/%domain%/stats/;
  52. include %home%/%user%/conf/web/%domain%.auth*;
  53. }
  54. include /etc/nginx/conf.d/phpmyadmin.inc*;
  55. include /etc/nginx/conf.d/phppgadmin.inc*;
  56. include /etc/nginx/conf.d/webmail.inc*;
  57. include %home%/%user%/conf/web/snginx.%domain%.conf*;
  58. }