matomo.conf 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. map $sent_http_content_type $expires {
  2. default off;
  3. text/html epoch;
  4. text/css max;
  5. application/javascript max;
  6. ~image/ max;
  7. }
  8. upstream matomo {
  9. server matomo-service-dockerbunker:80;
  10. }
  11. server {
  12. listen 80;
  13. server_name ${SERVICE_DOMAIN};
  14. return 301 https://$host$request_uri;
  15. }
  16. server {
  17. listen 443 ssl;
  18. server_name ${SERVICE_DOMAIN};
  19. ssl_certificate /etc/nginx/ssl/${SERVICE_DOMAIN}/cert.pem;
  20. ssl_certificate_key /etc/nginx/ssl/${SERVICE_DOMAIN}/key.pem;
  21. include /etc/nginx/includes/ssl.conf;
  22. add_header Strict-Transport-Security "max-age=15768000; includeSubDomains";
  23. add_header X-Frame-Options SAMEORIGIN;
  24. add_header X-XSS-Protection "1; mode=block";
  25. proxy_set_header X-Real-IP $remote_addr;
  26. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  27. proxy_set_header Host $http_host;
  28. include /etc/nginx/includes/gzip.conf;
  29. location / {
  30. proxy_pass http://matomo/;
  31. }
  32. expires $expires;
  33. location = /favicon.ico {
  34. log_not_found off;
  35. access_log off;
  36. }
  37. location ^~ /.well-known/ {
  38. access_log off;
  39. log_not_found off;
  40. root /var/www/html;
  41. # autoindex off;
  42. index index.html; # "no-such-file.txt",if expected protos don't need it
  43. try_files $uri $uri/ =404;
  44. }
  45. }