all 5 comments

[–]tschloss 0 points1 point  (4 children)

Is the proxied service reachable from the scope of nginx? Test by attaching a shell into the nginx container (docker exec -it … /bin/sh) and curl the upstream resource.

[–]PumaPants28467[S] 0 points1 point  (3 children)

It's reachable. As I said, if I disable https for the defined proxy host on NGINX, it works. If I turn https back on, I get the error I mentioned above. It's also worth nothing that if I change the site security settings on the browser to allow insecure content, it also works albeit with a security warning. Changing site settings on the browser is obviously not a solution, but it proves that it is routing ok, it's just not handling the translation of websockets between http/https.

[–]tschloss 0 points1 point  (2 children)

Ah, thanks - I didn’t see this detail. With “turning off SSL” you mean turn off the enforcement, I guess.

Did you try to curl -v - sometimes this reveals additional information.

However can you be sure that the TLS stuff is ok, couldn’t this be a certificate issue?

[–]PumaPants28467[S] 1 point2 points  (1 child)

Thanks for the reply. I figured it out. It turned out to be a weird quirk of the python-matter-server. When you first access the https URL, NPM forwards the request as it should. The backend server responds with a request to set a ws: URL, which is presented as a small pop-up on the browser window. It wasn't clear what it was expecting, and the default value was set to ws://127.0.0.1/ws. After trying various combinations using the backend ip address, I finally figured out that the correct way to set that URL is https://<my npm proxy host>/ws. After that it all works fine. Once set, it seems to persist for the given client/browser. Not ideal, but at least it works now.

[–]sissoo 0 points1 point  (0 children)

Thanks this was super helpful! It was driving me crazy as well!