|
View previous topic :: View next topic |
Author |
Message |
benjamin.kostner
Joined: 02 Apr 2014 Posts: 1
|
Posted: Wed Apr 02, 2014 8:12 am Post subject: HostMonitor: Web Interface 2.0 issue behind reverse proxy |
|
|
We're running Hostmonitor 9.84 on a server machine inside our server DMZ. The webinterface is accessible through a reverse proxy. When the interface is called via the reverse proxy, the interface data does not load.
After digging a bit in the JS files, I may have found a lead to the issue we encounter.
Our server setup is as follows:
The Webservice runs under this URL:
Code: | http://hostmonitor.ourdomain.local:8081/ |
The reverse proxy URL is:
Code: |
https://ourpublichost.at/hmadmin/
|
Apache has a reverseproxy rule to put all requests to /hmadmin/.* through to http://hostmonitor.ourdomain.local:8081/
This seems to work fine, except the XHRs from Javascript are called with a wrong URL, for example:
Code: | https://ourpublichost.at/data_update.txt?js=1&fid=-1&synctime=-1&ts=1396447148123 |
instead of
Code: | https://ourpublichost.at/hmadmin/data_update.txt?js=1&fid=-1&synctime=-1&ts=1396447148123 |
The problem seems to be in the paths used in e.g. tabs.js. There the URLs are prefixed with "../" as in "../data_update.txt" instead of calling "data_update.txt" (relatively to the called html page).
Internally, that works, because:
Code: | http://hostmonitor.ourdomain.local:8081/" + ../data_update.txt => http://hostmonitor.ourdomain.local:8081/data_update.txt
http://hostmonitor.ourdomain.local:8081/ + ../../data_update.txt => http://hostmonitor.ourdomain.local:8081/data_update.txt |
But with the reverse proxy in between this results in paths outside the /hmadmin/ base dir:
Code: | https://ourpublichost.at/hmadmin/ + ../data_update.txt => https://ourpublichost.at/data_update.txt
https://ourpublichost.at/ + ../../data_update.txt => https://ourpublichost.at/data_update.txt |
Is there a way to work around this problem or is this an issue with the current WebService of Advanced Host Monitor?
For the root page / or /index.htm it seems that the "../"-prefixes could be dropped in the JS without side effects, as the XHR-URLs are built relatively to the document they are called from, not the JS file they are called from.[/code] |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12807 Location: USA
|
|
Back to top |
|
|
mp1
Joined: 07 Mar 2006 Posts: 200
|
Posted: Sat Apr 05, 2014 2:25 am Post subject: |
|
|
Thanks Thanks ... that's great
Martin |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|