Internet p443 → Nginx Proxy Manager p443 → Freepbx p80
The admin panel works fine and the UCP login page loads, however it gets stuck on processing whenever one tries to log in and then their browser is stuck on a 502. I don’t know if this is because I am handling the https on the nginx proxy manager side or what, but nevertheless, it throws a few 404 and 502 errors in console and never loads. Accessing the UCP from the internal IP works fine.
I appreciate any help, and would happily troubleshoot anything that needs further clarification.
I have websocket passthrough enabled, but I read somewhere it works on a different port. 8003? Is that correct? I could likely write a config to pass that through as well. There was a wiki article about ports but it seems to be unavailable with the wiki move.
I got it to work, I found an old post of someone who did this with FreePBX on GitHub, and although it got me 90% there, I had to make some changes to FreePBX.
The following is also required to be done. Importantly, HTTPS must be enabled on your server. It doesn’t matter what certificate is used since that is handled by Nginx Proxy Manager anyways.
I installed the localhost certificate in Admin → System Admin → HTTPS. This allows the use of port 443. Now I used the above code snippet and set up the proxy in Nginx Proxy Manager as such:
The reason the device must be proxied as HTTPS is because if you have the FreePBX box on HTTP then it automatically tries to use port 8088/8001 as the port for the phone module. This will not work as the browser will not allow an insecure websocket while connected over HTTPS. By forwarding the proxy to the box over HTTPS, FreePBX correctly identifies that it should use ports 8003 and 8089 instead, which is correct and then it works properly. Glad I got this sorted, even if I will never use the phone module in the UCP