Page 1 of 1

URI error with non-standard port

Posted: Thu Dec 06, 2018 2:00 am
by gatomon
I've been running ZoneMinder on Ubuntu for a couple of years. I'm currently on version 18.04 of Ubuntu. I've recently updated ZoneMinder to 1.32.2 using the package updater. I've discovered a new issue with this update.

This worked before. The server works correctly on my local network. However, on the internet, port 443 on mywebsite,com goes to another server on my local network. Thus, I have a port forwarded from port say 1234, to port 443. Thus I can access the ZoneMinder server like this:

Code: Select all

https://mywebsite.com:1234/zm/index.php
This works and I can login. However, I cannot see the feeds. For example,

Code: Select all

https://mywebsite.com:1234/zm/index.php?view=watch&mid=6
is broken. We can see the problem in the log:

Code: Select all

web_js	ERR	SyntaxError: The URI is malformed.	https://mywebsite.com:1234/zm/tools/mootools/mootools-core.js
Viewing the webpage source:

Code: Select all

<div id="imageFeed"><img id="liveStream6" src="https://mywebsite.com:1234:1234/zm/cgi-bin/zms?scale=100&amp;width=640px&amp;height=480px...
you can see the error (the port extension is repeated).

I suspect that someone familiar with some of the recent changes in the code could sort this out.

Please?

Thanks,
-Chris

Re: URI error with non-standard port

Posted: Fri Dec 07, 2018 7:26 pm
by blauter
I have same errors. When clicking monitor, I see my external DNS name which is correct but internal port which is incorrect.

Re: URI error with non-standard port

Posted: Sat Dec 08, 2018 3:36 pm
by iconnor
We have just released 1.32.3 which we believe fixes this issue. Please give it a whirl.

Re: URI error with non-standard port

Posted: Sat Dec 08, 2018 5:37 pm
by blauter
Thanks for the quick reply. I gave it a go but with no luck. Port in url looks good now but switches to http instead of https. Most likely because I have nginx reverse proxy with SSL and then non-SSL from proxy to internal server.

I thought maybe it was controlled by ZM_BASE_PROTOCOL in index.php but I was wrong since forcing it to https did not change it :(

Re: URI error with non-standard port

Posted: Sat Dec 08, 2018 6:32 pm
by iconnor
So when in a non multi-server environment, the urls are built using the current url....

So if you are accessing zm via http://localhost:8443/zm then all urls should look like that. If not, then there must still be a bug.

One way of working around it is to specify a server under options->Servers, where you can specify hostname, url, http/https etc. You will then have to assign the monitor to that server and then urls will be built using the specifications provided for that server.

Might be a way to work around the problem.

Re: URI error with non-standard port

Posted: Sat Dec 08, 2018 7:12 pm
by gatomon
This problem was due to a bug in a file called Server.php. The bug was recently introduced with a change in how URLs are constructed. It has been corrected and will appear in the next update.

-Chris

PS: I've installed the corrected version in my server.

Re: URI error with non-standard port

Posted: Sat Dec 08, 2018 7:49 pm
by blauter
Great, thanks both of you. I will hold off until next update as it doesn't majorly affect me since I am using mostly ZMNinja. But glad there is a workaround available if needed before then.