Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Denying /plugins results in missing images/icons in the GUI #78

Open
mrimann opened this issue Nov 10, 2023 · 2 comments
Open

Denying /plugins results in missing images/icons in the GUI #78

mrimann opened this issue Nov 10, 2023 · 2 comments

Comments

@mrimann
Copy link

mrimann commented Nov 10, 2023

The current suggestion is to render a 403 forbidden response to requests for /plugins/..., with the following rule (see https://github.com/matomo-org/matomo-nginx/blob/5b232af8ec1fd9d033f1c4ab9343f4073df64644/sites-available/matomo.conf#L80C1-L83C6):

    location ~ ^/(libs|vendor|plugins|misc|node_modules) {
        deny all;
        return 403;
    }

This results in e.g. the Matomo Logo on top left corner of the Matomo GUI to be unavailable: https://your.webserver.tld/plugins/Morpheus/images/logo.svg?matomo

Suggested solution: add a more specific location matcher so that requests to images are still possible, but not neccessarily everything unter /plugins/ is reachable.

@dfranco
Copy link

dfranco commented Jul 2, 2024

I'm facing the same issue with Matomo 5.1.0

@dfranco
Copy link

dfranco commented Jul 2, 2024

Found a way to fix the nginx config by add below block

...
location ~*  \.(jpg|jpeg|png|gif|css|js|ico|svg|woff)$ {
    expires 1d;
  }
...

Above block MUST be declared before corresponding blow such as

...
location /some.path {
  deny all;
  return 403;
}
...

I've the cache expiration to 1 day, feel free to change this value at your convenience.

Hope it helps others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants