KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

HostMonitor: Web Interface 2.0 issue behind reverse proxy

 
Post new topic   Reply to topic    KS-Soft Forum Index -> Bug reports
View previous topic :: View next topic  
Author Message
benjamin.kostner



Joined: 02 Apr 2014
Posts: 1

PostPosted: Wed Apr 02, 2014 8:12 am    Post subject: HostMonitor: Web Interface 2.0 issue behind reverse proxy Reply with quote

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
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12303
Location: USA

PostPosted: Thu Apr 03, 2014 10:33 am    Post subject: Reply with quote

There is update
www.ks-soft.net/download/hm984c.exe

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
mp1



Joined: 07 Mar 2006
Posts: 200

PostPosted: Sat Apr 05, 2014 2:25 am    Post subject: Reply with quote

Thanks Thanks ... that's great

Martin
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> Bug reports All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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

KS-Soft Forum Index