URI error with non-standard port

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
gatomon
Posts: 2
Joined: Fri Aug 19, 2016 6:40 pm

URI error with non-standard port

Post 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
blauter
Posts: 7
Joined: Fri Dec 07, 2018 7:23 pm

Re: URI error with non-standard port

Post by blauter »

I have same errors. When clicking monitor, I see my external DNS name which is correct but internal port which is incorrect.
User avatar
iconnor
Posts: 2881
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: URI error with non-standard port

Post by iconnor »

We have just released 1.32.3 which we believe fixes this issue. Please give it a whirl.
blauter
Posts: 7
Joined: Fri Dec 07, 2018 7:23 pm

Re: URI error with non-standard port

Post 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 :(
User avatar
iconnor
Posts: 2881
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: URI error with non-standard port

Post 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.
gatomon
Posts: 2
Joined: Fri Aug 19, 2016 6:40 pm

Re: URI error with non-standard port

Post 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.
blauter
Posts: 7
Joined: Fri Dec 07, 2018 7:23 pm

Re: URI error with non-standard port

Post 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.
Post Reply