[ZBX-4986] multiple pages don't work properly through reverse proxy Created: 2012 May 10 Updated: 2017 May 30 Resolved: 2013 Jul 31 |
|
| Status: | Closed |
| Project: | ZABBIX BUGS AND ISSUES |
| Component/s: | Frontend (F) |
| Affects Version/s: | 1.8.12 |
| Fix Version/s: | 2.1.2, 2.2.0 |
| Type: | Incident report | Priority: | Major |
| Reporter: | John Airey | Assignee: | Unassigned |
| Resolution: | Fixed | Votes: | 9 |
| Labels: | usability | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Any Linux server that has the frontend installed and accesses the front end with a link like http://rewritehost/zabbixhost/zabbix/ |
||
| Attachments: |
|
||||||||||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||||||||||
| Description |
|
When using mod_proxy as follows on the rewritehost: ProxyPass /zabbixhost http://zabbixhost Changing the sort order of hosts or triggers sends you to http://zabbixhost/zabbix/... instead - which is probably not reachable directly (if it was, you wouldn't be using mod_rewrite and mod_proxy). The solution is to change this line in /usr/share/zabbix/include/func.inc.php from $script = "javascript: redirect('".$url."');"; to $script = "javascript: redirect('".basename($url)."');"; I don't think this will adversely affect anything else. Without the above you have to manually amend the link from http://zabbixhost/zabbix/... to http://rewitehost/zabbixhost/zabbix/... in your browser. At the moment I'm making this change manually with each new release however if someone can put this change into the source it would be appreciated. Thank you kindly |
| Comments |
| Comment by richlv [ 2012 May 10 ] |
|
let's try handle everything known about reverse proxy mode problems in |
| Comment by Onlyjob [ 2012 Jun 26 ] |
|
I'd like to vote for this change. This is still an issue in 2.0.0 and it is causing grief for nginx/php-fpm as well. |
| Comment by Onlyjob [ 2012 Oct 21 ] |
|
Just to share our experience, I had this correction since 2.0.0 release. As far as I'm aware there is no regressions here or we would get bug report(s) already. |
| Comment by Onlyjob [ 2012 Nov 01 ] |
|
I've just found that on nginx/php-fpm this issue also affects pagination. I attached the "basename.patch" to address this problem. Thanks. |
| Comment by John Airey [ 2012 Nov 02 ] |
|
As Dmitry Smirnov says, I've tested his patch above and it fixes this issue and the additional issue he reports (for some reason on the CentOS/Red Hat EPEL version the first hunk of the patch fails but you can fix the line manually). Simply put, there is no reason to include the hostname in the URL sent to the browser. Relative links from the document root are all that's required and that can be proxied as many times as necessary. |
| Comment by Ilyas [ 2012 Nov 19 ] |
|
I confirm that this bug still present in my zabbix-2.0.3 installation. I run nginx as frontend (with SSL) and php-fpm as backend. I get links which follow to URLs like this (cut from page HTML source):
onclick="javascript: redirect("https://:443/host_discovery.php?hostid=10086&sid=3e79632f9bc33d17&sort=delay&sortorder=ASC");"
If you need I can attach my nginx and php-fpm configuration files. |
| Comment by richlv [ 2013 May 12 ] |
|
it seems this problem is present in :
|
| Comment by Łukasz Jernaś [ 2013 May 21 ] |
|
Any ETA on this? Turns out we hit that when running on a different port behind a load balancer... |
| Comment by Oleksii Zagorskyi [ 2013 Jun 15 ] |
|
See also |
| Comment by Filipe Paternot [ 2013 Jul 19 ] |
|
With the supplied patch and running on frontend 2.0.6 its working nice. Wasnt working with 2.0.4 non-pathched. |
| Comment by Guntis Zarins (Inactive) [ 2013 Jul 23 ] |
|
Changed getUrl method for returning relative url's. I not found places, where require absolute url, but i add parameter '$absoluteUrl' if accidently have necessary return absolute url. This will fix:
Revision r37228. RESOLVED. |
| Comment by Volker Fröhlich [ 2013 Jul 23 ] |
|
Can you backport that to 2.0? If not, that'd be a patch I'd include in Fedora/EPEL. |
| Comment by Pavels Jelisejevs (Inactive) [ 2013 Jul 24 ] |
|
(1) basename() is not required in Curl::getUrl(). If I create a url like new Curl('dir/trigger.php'), I want getUrl() to return "dir/trigger.php" not just "trigger.php". guntis.zarins Resolved in r37297. RESOLVED jelisejev It would be better to remove all of the unused parsing code. It's currently not needed. guntis.zarins RESOLVED in r37412. jelisejev A fatal error occurs when I try to save a host: "Fatal error: Call to undefined method Curl::getPath() in /opt/lampp/htdocs/zabbix/trunk/frontends/php/include/func.inc.php on line 2578" Also please review my minor changes in r37426. guntis.zarins Reviewed and RESOLVED in 37435. jelisejev CLOSED. I've done some minor changes in r37439. |
| Comment by Pavels Jelisejevs (Inactive) [ 2013 Jul 24 ] |
|
(2) We write "bool" instead of "boolean" in the phpdoc comments. guntis.zarins Resolved in 37297. RESOLVED. jelisejev CLOSED. |
| Comment by Pavels Jelisejevs (Inactive) [ 2013 Jul 24 ] |
|
Volker, yes, this fix will also be backported to 2.0 (probably, 2.0.7rc1). |
| Comment by Guntis Zarins (Inactive) [ 2013 Jul 25 ] |
|
RESOLVED |
| Comment by Pavels Jelisejevs (Inactive) [ 2013 Jul 30 ] |
|
(3) When we create an object with a relative URL, we should not add the current GET parameters to it. For example: $url = new Curl('triggers.php'); $url->setArgument('test', 2); var_dump($url->getUrl()); guntis.zarins RESOLVED in r37409. jelisejev CLOSED. |
| Comment by Pavels Jelisejevs (Inactive) [ 2013 Jul 31 ] |
|
TESTED. |
| Comment by Volker Fröhlich [ 2013 Jul 31 ] |
|
It didn't go into 2.0.7, so I'll probably patch it in for EPEL. |
| Comment by Guntis Zarins (Inactive) [ 2013 Aug 01 ] |
|
(4) Created development branch for 2.0 and updated with required changes. Please test made changes. guntis.zarins Revision [svn://svn.zabbix.com/branches/dev/ZBX-4986-2.0] r37497. jelisejev After testing the fix with 2.0 we've uncovered some problems with the old 2.0 codebase and decided not to port this fix to 2.0. CLOSED. |
| Comment by Pavels Jelisejevs (Inactive) [ 2013 Aug 01 ] |
|
(5) Documented the changes in the "What's new" section. https://www.zabbix.com/documentation/2.2/manual/introduction/whatsnew220?&#miscellaneous_improvements <richlv> i slightly reworded it (although maartinjsh might want to improve it further), CLOSED |
| Comment by Volker Fröhlich [ 2013 Aug 04 ] |
|
No EPEL backport, consequently to what Pavels says. You might want to talk to Dmitry Smirnov about that too; see the latest entry here: http://ftp-master.metadata.debian.org/changelogs//main/z/zabbix/zabbix_2.0.6+dfsg-2_changelog |