0

I'm trying to setup Matomo analytics "on-Premise". My Website is based on Next.js and running with pm2 (Ubuntu 22.04). The web server is nginx and is being used as a reverse proxy. I suspect some nginx configuration is required.

I tried following the official guide (https://matomo.org/faq/on-premise/installing-matomo/) and copied the Matomo files into '/var/www' but can't access it.

The nginx config file 'MY.PAGE.com' inside the site-available folder looks like this:

server {
        client_max_body_size 64M;
        server_name MY.PAGE.com www.MY.PAGE.com;

        location / {
                proxy_pass             http://127.0.0.1:3000;
                proxy_read_timeout     60;
                proxy_connect_timeout  60;
                proxy_redirect         off;

                # Allow the use of websockets
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection 'upgrade';
                proxy_set_header Host $host;
                proxy_cache_bypass $http_upgrade;
        }

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/MY.PAGE.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/MY.PAGE.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

server {
    if ($host = MY.PAGE.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

        listen 80;
        server_name MY.PAGE.com www.MY.PAGE.com;
    return 404; # managed by Certbot
}

My goal is to be able to access Matomo (at least while connected to the server) and have it analyse the Next.js page im running.

Mildly
  • 11
  • 2

0 Answers0