Authorization problem on https / Node app seems to have jumped from http to https

nodejs

#1

My node app was running http at:
"http://xx-yy.c9users.io"
It is accessed by xhr from another domain. and it also has wget posting to it over http.
It has been running fine.

But I have been playing with https on that domain over the last day.
Now it claims to be running at https://xx-yy.c9users.io", but the chrome error message suggests it may be being redirected and losing header info along the way???
WGET also fails. In the c9 console there are no longer any requests happening i.e. the requests are not making it as far as node.
Is this some sort of authorization problem??

This breaks the xhrequest which is calling from http://

Note this worked happily before, and the request handler include: response.writeHead(200, {“Cache-Control”: “private”,
“Content-Type”: “text/html”,
“Access-Control-Allow-Origin” : “*”
});
It seems that it was intially working when I did xhr from an https page, but now even that also errors.

Chrome error message from http page:

XMLHttpRequest cannot load http://xx-yy.c9.io/download?ch=47epkIPSDE&ep=3&sb=0. Redirect from 'http://xx-yy.c9.io/download?ch=47epkIPSDE&ep=3&sb=0' to 'https://c9.io/_user_content/authorize?redirect=http%3A%2F%2Fxx-yy.c9.io%2Fdownload%3Fch%3D47epkIPSDE%26ep%3D3%26sb%3D0' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.i2cchip.com' is therefore not allowed access.


Chrome error from https:

MLHttpRequest cannot load https://xx-yy.c9.io/download?ch=47epkIPSDE&ep=5&sb=0. Redirect from 'https://xx-yy.c9.io/download?ch=47epkIPSDE&ep=5&sb=0' to 'https://c9.io/_user_content/authorize?redirect=https%3A%2F%2Fxx-yy.c9.io%2Fdownload%3Fch%3D47epkIPSDE%26ep%3D5%26sb%3D0' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://www.i2cchip.com' is therefore not allowed access.


Messages from wget process:

Resolving xx-yy.c9users.io... 104.155.203.100
Connecting to  xx-yy.c9users.io|104.155.203.100|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://c9users.io/_user_content/authorize?redirect=http%3A%2F%2F xx-yy.c9users.io%2Fupload%3Fch%3D47epkIPSDE%26ep%3D0%26sn%3D18750%26ts%3D1486340885%26ty%3D1%26dt%3D00000218%2C40 [following]
https://c9users.io/_user_content/authorize?redirect=http%3A%2F%2F xx-yy.c9users.io%2Fupload%3Fch%3D47epkIPSDE%26ep%3D0%26sn%3D18750%26ts%3D1486340885%26ty%3D1%26dt%3D00000218%2C40: HTTPS support not compiled in.