Closed jenisov closed 4 years ago
do you have the files to reproduce this?
it should not be necessary to use FORCE_DOMAIN
and FORCE_PORT
if you are using nginx as proxy, but that depends on how you deployed WireCloud.
Apparently FORCE_PORT is necessary because all widgets' iframes were not accessible because Wirecloud used default (80) port for all of them.
I based on docker-compose-simple.yml with some modifications (attaching) wirecloud.zip
Ok, I've found the problem.
FORCE_DOMAIN
and FORCE_PORT
is not required because we are using FORWARDED_ALLOW_IPS=*
so nginx should provide those details to WireCloud and them should be accepted.
On the other hand, nginx is not correctly configured so port is not transmitted. Please, change the following line in the nginx.conf
file:
proxy_set_header Host $host;
to
proxy_set_header Host $host:$server_port;
I will change the example nginx.conf
files if you confirm this fix the problem.
I can confirm this nginx.conf solves 403 error.
But now WireCloud proxy returns 502 (Bad Gateway):
9cfed7959b48.js:154 GET http://iotcloud:1080/cdp/http/cloud.server.com/orion/v2/entities?limit=20&offset=0&options=count%2CkeyValues&idPattern=.* 502 (Bad Gateway)
And NGSI browser displays:
ConnectionError: Connection Error
non-proxy URL works well though:
http://cloud.server.com/orion/v2/entities?limit=20&offset=0&options=count%2CkeyValues&idPattern=.*
[{"id":"mbitX","type":"MicroBit","acceleration":[0,0,0.5],"dateModified":"2020-02-25T17:34:46.912Z","description":"MicroBit Shadow","name":"MicroBit"}]
Found the problem: 502 it is my server DNS issue.
After logging in with superuser and adding NGSI browser widget it shows message:
Chrome debug console says:
The only change in setup is listen nginx on port 1080 and settings.py was mounted with FORCE_DOMAIN and FORCE_PORT set to proper values.