Cannot use UCP behind nginx reverse proxy manager

Hi,

I have been following the post by maevebaksa here

I am in the same situation however sadly for me I am still getting the “Unable to connect to the UCP Node Server. Error: xhr poll error” in the top right corner.

I have coppied the working advanced config into Nginx, and have undertaken admin for HTTPS certs in FreePBX. I can log in and all works with the exception of this error and the phone widget of course wont fully regester. My understanding is this is an issue with ports 8003 & 8089 but I am unsure how to trouble shoot this issue? e.g where is the problem initialy - FreePBX or Nginx or both?

The issue seems possible to resolve but I have had no joy and seeking a litle push in the right direction to trouble shoot or hear of anyhting obvious I may be missing.

I am running PBX Version:16.0.40.11, PBX Distro:12.7.8-2306-1.sng7, Asterisk Version: 18.20.2 and all is up to date.

Further update - I am making the guess I should be able to use an open port checker to see if ports 8003 and 8089 are open. Port 443 is showing as open so I know that part of nginx is working but 8003 and 8089 show as closed - I am assuming they should show as open right? If so can I assume the issue is with nginx and the proxy pass element?

I have noticed that if I navigate to ip/80 the page does not load correctly if accessed over a LAN from multiple browsers. If I do the same on the Vbox host machine it works fine. Accessing via nginx/domain from any where works fine. The page that does not load correctly and is inoperable is as below image:

As such I wonder if then I need to fix this issue first? I am guessing it will be network related as partially loads. Almost like there is a bottleneck / time out. I have tested with all firewalls off also and no difference.

I am making the assumption if this can be resolved I may stand a better chance of sorting the main detailed issue, or infact they may be related since the Nginx points to local IP?

I have even created a new Vbox install and the same issue persists so this leads further pointing to network related issues – but how to test further and what to review? In short

https://LanIP/admin/config.php

loads on vbox linux host, but does not from other devices on the local network.

https://MyDomain/admin/config.php

loads any place lan or wan.

I have now checked all I can and am now at a complete loss as to what to check next. New installs, removed all firewalls, tried different browsers and devices. All have the same issue. The only way a local LAN IP connects correctly is via the Linux box the VBox is hosted on or via the domain name through Nginx. Only last thought is could it be something to do with TLS? I see browsers state encryption is 1.3 and FreePBX only support > 1.2 I think? Thoughts any one?

It seems like you’re encountering the “xhr poll error” related to FreePBX and UCP (User Control Panel). This issue is often related to WebSocket communication between the client (browser) and the UCP Node Server. When using Nginx as a reverse proxy, there are a few common configurations that might be missing or incorrect, especially around WebSocket handling on ports like 8003 and 8089.

The UCP Node Server is responsible for handling WebSocket connections. If it’s not running or is encountering issues, you might see the error you’re experiencing.

ps aux | grep node

Hi Muhammad, thank you for taking the time to reply and offer support. The settings in Nginx are exactly as per the post I linked to – can you see anything there that does not look correct relating to Websocets? Any suggestions as to what to change / try?

Regarding the FreePBX system and ensuring the UCP node server is running – Thank you for sharing the CMD. I have logged in as root via SSH and issued the CMD and I get:

ps aux | grep node asterisk 2996 0.1 0.2 983188 32424 ? Ssl 11:57 0:00 node /var/www/html/admin/modules/core/node/fastagi-server.js
asterisk 3405 0.8 0.6 1234176 80676 ? Ssl 11:57 0:02 node /var/www/html/admin/modules/sangomartapi/node/kickstart.js
asterisk 3529 0.4 0.3 1076456 46640 ? Ssl 11:57 0:01 node /var/www/html/admin/modules/ucp/node/index.js
root 5075 0.0 0.0 112808 968 pts/1 S+ 12:03 0:00 grep --color=auto node

I can’t see anything here that could indicate the issue – how about you?

I will get there with this as I know it possible to get it working – I just need to pinpoint the exact issue in my set up and the networking side has now gone a little above my knowledge so I’m learning as I go.