piwik.stpl 2.0 KB

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