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

hosting matomo in subdirectory #13627

Open
courtens opened this issue Oct 18, 2018 · 5 comments
Open

hosting matomo in subdirectory #13627

courtens opened this issue Oct 18, 2018 · 5 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc.

Comments

@courtens
Copy link

I reported this problem some time ago in the forum under "Bug? Proxy redirect to root after login success - instead of staying within assigned sub-folder". If I remember right the problem started about 3 years ago with one of the mayor updates.

The problem is that I can not host the code from within a sub-folder of a website without some functions not working. Some of the problems: 1) During login I get redirected to the root folder. 2) "All Websites" index.php?module=MultiSites&action=index&idSite=1&period=range&date=previous30 produces a page with no record content showing.

@micw
Copy link

micw commented Nov 20, 2018

If you run it behind a proxy, you can configure it this way: https://matomo.org/faq/how-to-install/faq_98/
But IMO this should be an application setting and should not rely on special proxy settings.

@heikojansen
Copy link

I don't know if 1) is related to the MultiSites plugin but 2) certainly is:

I see data in the "All Websites" page but the sparkline graphics do not show up.
I think this is because here:

return piwik.piwik_url + '?module=MultiSites&action=getEvolutionGraph&period=' + $scope.period + '&date=' + $scope.dateSparkline + '&evolutionBy=' + metric + '&columns=' + metric + '&idSite=' + website.idsite + '&idsite=' + website.idsite + '&viewDataTable=sparkline' + append + '&colors=' + encodeURIComponent(JSON.stringify(piwik.getSparklineColors()));

the URL used for the sparkline generation is absolute in relation to the installation and thus not working when used behind a reverse proxy and in a different subdirectory.

This can be fixed by simply removing the "piwik.piwik_url" part from the returned URL.

Just make sure to run "php ./console cache:clear" to see any effect.

@Findus23 Findus23 added the Bug For errors / faults / flaws / inconsistencies etc. label May 23, 2020
@chrisv-dev
Copy link

chrisv-dev commented Jun 9, 2020

@micw Are you talking about adding the X-Forwarded-Uri Header for the proxying webserver and setting the proxy_uri_header = 1 inside config/config.ini.php ? I tried that but I still get 302 redirects to / after login.

If you run it behind a proxy, you can configure it this way: https://matomo.org/faq/how-to-install/faq_98/
But IMO this should be an application setting and should not rely on special proxy settings.

@micw
Copy link

micw commented Jun 9, 2020

Can't remember (was 1,5 years ago) and I don't use it anymore.

@d2a-raudenaerde
Copy link

@heikojansen The MultiSites is broken I think, see : https://forum.matomo.org/t/4-4-1-reverse-proxy-links-to-websites-on-dashboard-dont-work-properly/42978
Did you have any success running it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

7 participants