UCP not working with custom URL

I am having trouble accessing the UCP using our custom URL “phone.companyname.com” When I use the local IP it works fine.

To reproduce, I log on the system at phone.companyname.com and click “UCP” it directs me to phone.companyname.com/ucp" and gives me a 502 error. If I go to myPBXlocalIP/UCP it works fine.

This was working before. I recently purchased and downloaded the following commercial modules, not sure if this is the cause
Endpoint Manager
Endpoint - UCP integration
SysAdmin Pro
voicemail reports

502 is a gateway error. That is coming from apache or your browser (probably from an endless redirect loop) not from anything we are doing.

Thanks Andrew, That led me to check my Nginx error log, I had the following error

2014/12/01 23:36:25 [error] 2015#0: *5 upstream sent too big header while reading response header from upstream, client:, server: Phone.companyname.com, request: “GET /ucp/ HTTP/1.1”, upstream: “”, host: “phone.companyname.com”, referrer:“http://phone.companyname.com/admin/config.php?display=sysadmin&view=ddns”

Adding this to my nginx config fixed it

proxy_buffer_size 64k;
proxy_buffers 4 128k;
proxy_busy_buffers_size 128k;

I have two servers, one being the PBX, on a single static IP so I’m using my Nginx to redirect to the PBX

Just adding this in case it happens to someone else