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
Some URLs not resolved appropriately behind proxy #6644
Comments
Hi @ToBeReplaced thanks for the report. Do you also experience this issue: #6703 ? |
The real-time map fails to work. However, I do not experience the same issue: I see a failed request to Sorry for the delay. |
I am also experiencing this issue. When logging into Piwik using the URL:
I am redirected to:
Which is causing some confusion and annoyance. When I press Back I am taken to the dashboard. |
let's investigate this issue as part of the broader set of bugs in #6880 -> our goal will be to make Piwik work perfectly in this special use case which many users have reported issues with. |
@ToBeReplaced Could you please document the rewrite you've used? Thanks in advance! |
@patriiiiiiiiiick This is an extract of my
In the piwik host:
|
can you let us know the content of PHP To get it, can you create a file like
afterwards you can open this file by opening the URL |
I placed
This is after my fancy rewrites as indicated above though, so it might not be particularly helpful. Notably, the "analytics" prefix is nowhere to be seen. I don't know what you are planning, but for me, it would be great to specify a "url_prefix" in I might also be misunderstanding altogether now; This was a while back, and I haven't touched my installation since I first spun it up -- almost a year now! |
I've got the exact same issue |
Issue still exists, most likely because SettingPiwik::getPiwikUrl (with the help of URL::getCurrentScriptName) determines the URL wrong. There is even a DB option for "piwikUrl", but manually setting it to the correct URL is being overwritten immediately upon next request. Edit, got one workaround to work successfully: Move Piwik in subfolder named identically to the path the reverse proxy is using, i.e. to /path/to/wwwroot/analytics/ instead of /path/to/wwwroot/. nginx vhost conf of reverse proxy:
nginx vhost conf for piwik:
|
Thanks for posting your workaround @fhadlich |
I could resolve the issue by patching the core/Url.php
I fixed it with an additional check:
|
a new pull request was submitted by @user121216 in #12011 and addresses this issue (by adding a new nginx setting for |
@mattab Thank you for the callback on this. I am unfortunately not in a position to test the PR. Hopefully another affected user will be able to chime in. |
I can't locate/reproduce this issue now (I can't remember if we applied some of the workarounds above) and can't justify having it tested as the concerned instance is in phase out. I'll notify other people in case they can give it a try. |
Hi everyone, Since #12011 was merged, we consider this issue fixed. Please check the FAQ here for more information: https://piwik.org/faq/how-to-install/faq_98/ in particular check the section Feedback welcome! |
@mattab Can you look into the issue that @benjaminpesch posted about? As @benjaminpesch pointed out, there is this code in Version 3.3.0: if ($removePathInfo && isset($_SERVER['PATH_INFO']) ) {
$url = substr($url, 0, -strlen($_SERVER['PATH_INFO']));
} Before the /**
* SCRIPT_NAME is our fallback, though it may not be set correctly
*
* @see http://php.net/manual/en/reserved.variables.php
*/
if (empty($url)) {
if (isset($_SERVER['SCRIPT_NAME'])) {
$url = $_SERVER['SCRIPT_NAME'];
} elseif (isset($_SERVER['SCRIPT_FILENAME'])) {
$url = $_SERVER['SCRIPT_FILENAME'];
} elseif (isset($_SERVER['argv'])) {
$url = $_SERVER['argv'][0];
}
} tl;dr: |
If PATH_INFO is defined, but empty, this line otherwise causes the URL to be rewritten incorrectly As reported in #6644 (comment)
If PATH_INFO is defined, but empty, this line otherwise causes the URL to be rewritten incorrectly As reported in #6644 (comment)
If you use a reverse proxy to host Piwik at
https://www.example.com/analytics/index.php
, piwik will attempt to requesthttps://www.example.com/plugins/Morpheus/images/logo.svg
. Similarly, when you log in, it will redirect tohttps://www.example.com/index.php
.Is there a way to specify a url prefix for redirects (ex. the 302 after log-in?).
Other than the
logo.svg
, other assets appear to resolve properly.Right now, this is solvable with rewrites from the proxy, so it's not a priority.
The text was updated successfully, but these errors were encountered: