Hi. FreePBX uses a special instance of apache runing under asterisk account. This instance is accessible with ProxyPass, just like the server-manager. That means that if you getBad Gateway
The proxy server received an invalid response from an upstream server.
then there's something wrong with this instance of apache. You should check it's runing:
expand-template /etc/httpd/fpbx-conf/httpd.conf
httpd -f /etc/httpd/fpbx-conf/httpd.conf -t
You should see a message like Syntax OK
If it's the case, then, run sv t /service/httpd-fpbx
You can also look at the logs to see what's going on:
tailf /var/log/httpd/fpbx_error_log