Giter VIP home page Giter VIP logo

matomo-nginx's Introduction

Nginx Configuration for Matomo

This is a small nginx configuration that should help you get your own Matomo instance running and start collecting your own analytics.

I already know nginx

In this case it should be enough to just take the sites-available/matomo.conf, check if everything is configured as you like it and enable the config.

I want to get started

  • clone this repostitory or download it as a zip then move its content to /etc/nginx/ (or wherever you store your nginx-config)
  • read through the sites-available/matomo.conf and modify the settings to fit your use case:
    • set server_name to the domain(s) of your Matomo instance
    • set the path to your SSL certificate (I really recommend you to make sure your Matomo instance is only reachable via HTTPS. If you don't have an SSL certificate for your domain yet, check out Let's Encrypt.)
    • do you want to support old browsers? Then you'll need to modify ssl.conf according to your need. (the Mozilla SSL Config Generator will help you)
    • replace /var/www/matomo/ with the path to your Matomo instance
  • configure PHP (this depends on your OS and PHP setup)
    • if you are using fastcgi (which is probably the case) set fastcgi_pass to the path of your PHP socket file
    • you can also specify a TCP port
  • go to the sites-enabled folder of your nginx config directory
  • enable the Matomo config by creating a symlink: sudo ln -s ../sites-available/matomo.conf
  • test if there is a syntax error in your config: sudo nginx -t
  • restart nginx: sudo systemctl restart nginx

If you need to check the legacy nginx Matomo configuration, you can find it here: https://github.com/matomo-org/matomo-nginx/tree/1.0.99

Tips

  • never use Matomo without HTTPS
  • make sure you have configured Nginx to only accept modern and secure cryptography
  • add server_tokens off; to your config to disable the server: nginx header on all requests and the nginx version on error pages
  • if you have enabled gzip compression (which improves performance greatly), be aware of the BREACH vulnerability
  • think about enabling the Strict-Transport-Security header, but keep in mind the implications
  • keep HTTP/2 enabled as it brings performance benifits with many small files (e.g. icons)

You know how to improve this config? Open a pull request or GitHub issue!

matomo-nginx's People

Contributors

findus23 avatar mattab avatar bbodenmiller avatar frost-nzcr4 avatar perusio avatar blueyed avatar rixafy avatar simpaa avatar sb-relaxt-at avatar tsteur avatar axelsimon avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.